widget: Don't use GdkDeviceManager
We can just as well use GdkSeat to enumerate the devices.
This commit is contained in:
@@ -10305,27 +10305,22 @@ _gtk_widget_get_device_window (GtkWidget *widget,
|
||||
}
|
||||
|
||||
static void
|
||||
list_devices (GtkWidget *widget,
|
||||
GdkDeviceManager *device_manager,
|
||||
GdkDeviceType device_type,
|
||||
GList **result)
|
||||
list_devices (GtkWidget *widget,
|
||||
GdkSeat *seat,
|
||||
GList **result)
|
||||
{
|
||||
GList *devices;
|
||||
GList *l;
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
|
||||
devices = gdk_device_manager_list_devices (device_manager, device_type);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS;
|
||||
*result = g_list_prepend (*result, gdk_seat_get_pointer (seat));
|
||||
|
||||
devices = gdk_seat_get_slaves (seat, GDK_SEAT_CAPABILITY_ALL_POINTING);
|
||||
for (l = devices; l; l = l->next)
|
||||
{
|
||||
GdkDevice *device = l->data;
|
||||
if (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD)
|
||||
{
|
||||
GdkWindow *window = gdk_device_get_last_event_window (device);
|
||||
if (window && is_my_window (widget, window))
|
||||
*result = g_list_prepend (*result, device);
|
||||
}
|
||||
GdkWindow *window = gdk_device_get_last_event_window (device);
|
||||
if (window && is_my_window (widget, window))
|
||||
*result = g_list_prepend (*result, device);
|
||||
}
|
||||
g_list_free (devices);
|
||||
}
|
||||
@@ -10342,8 +10337,7 @@ list_devices (GtkWidget *widget,
|
||||
GList *
|
||||
_gtk_widget_list_devices (GtkWidget *widget)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
GdkDeviceManager *device_manager;
|
||||
GdkSeat *seat;
|
||||
GList *result = NULL;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
|
||||
@@ -10351,14 +10345,12 @@ _gtk_widget_list_devices (GtkWidget *widget)
|
||||
if (!_gtk_widget_get_mapped (widget))
|
||||
return NULL;
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
|
||||
display = gtk_widget_get_display (widget);
|
||||
device_manager = gdk_display_get_device_manager (display);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS;
|
||||
seat = gdk_display_get_default_seat (gtk_widget_get_display (widget));
|
||||
|
||||
list_devices (widget, device_manager, GDK_DEVICE_TYPE_MASTER, &result);
|
||||
/* Rare, but we can get events for grabbed slave devices */
|
||||
list_devices (widget, device_manager, GDK_DEVICE_TYPE_SLAVE, &result);
|
||||
result = gdk_seat_get_slaves (seat, GDK_SEAT_CAPABILITY_KEYBOARD);
|
||||
result = g_list_prepend (result, gdk_seat_get_keyboard (seat));
|
||||
|
||||
list_devices (widget, seat, &result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user