mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-02 17:00:19 +00:00
treeview: Don't use GdkDeviceManager
We can just as well use GdkSeat to enumerate (attached) devices. Note that this change excludes floating devices from consideration. This keeps the copy-pasted code in sync with gtkwindow.c
This commit is contained in:
parent
7c0a1ddb05
commit
835805ad61
@ -10638,15 +10638,12 @@ send_focus_change (GtkWidget *widget,
|
||||
GdkDevice *device,
|
||||
gboolean in)
|
||||
{
|
||||
GdkDeviceManager *device_manager;
|
||||
GdkSeat *seat;
|
||||
GList *devices, *d;
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
|
||||
device_manager = gdk_display_get_device_manager (gtk_widget_get_display (widget));
|
||||
devices = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_MASTER);
|
||||
devices = g_list_concat (devices, gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_SLAVE));
|
||||
devices = g_list_concat (devices, gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_FLOATING));
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS;
|
||||
seat = gdk_display_get_default_seat (gtk_widget_get_display (widget));
|
||||
devices = gdk_seat_get_slaves (seat, GDK_SEAT_CAPABILITY_KEYBOARD);
|
||||
devices = g_list_prepend (devices, gdk_seat_get_keyboard (seat));
|
||||
|
||||
for (d = devices; d; d = d->next)
|
||||
{
|
||||
@ -10654,14 +10651,10 @@ send_focus_change (GtkWidget *widget,
|
||||
GdkEvent *fevent;
|
||||
GdkWindow *window;
|
||||
|
||||
if (gdk_device_get_source (dev) != GDK_SOURCE_KEYBOARD)
|
||||
continue;
|
||||
|
||||
window = gtk_widget_get_window (widget);
|
||||
|
||||
/* Skip non-master keyboards that haven't
|
||||
* selected for events from this window
|
||||
*/
|
||||
window = gtk_widget_get_window (widget);
|
||||
if (gdk_device_get_device_type (dev) != GDK_DEVICE_TYPE_MASTER &&
|
||||
!gdk_window_get_device_events (window, dev))
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user