Commit 835805ad authored by Matthias Clasen's avatar Matthias Clasen
Browse files

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
parent 7c0a1ddb
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment