[gtk+/wip/matthiasc/kill-device-manager: 8/14] window: Don't use GdkDeviceManager
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/matthiasc/kill-device-manager: 8/14] window: Don't use GdkDeviceManager
- Date: Thu, 23 Nov 2017 21:39:40 +0000 (UTC)
commit 5229eff2395934e1d0e19a8517435fba7bbb4760
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Nov 23 15:39:19 2017 -0500
window: Don't use GdkDeviceManager
We can just as well use GdkSeat to enumerate (attached)
devices. Note that this change excludes floating devices
from consideration.
gtk/gtkwindow.c | 16 +++++-----------
1 files changed, 5 insertions(+), 11 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 9144ce6..01bc34e 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -7555,26 +7555,20 @@ static void
do_focus_change (GtkWidget *widget,
gboolean in)
{
- GdkWindow *window;
- GdkDeviceManager *device_manager;
+ GdkSeat *seat;
GList *devices, *d;
g_object_ref (widget);
- 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)
{
GdkDevice *dev = d->data;
GdkEvent *fevent;
-
- if (gdk_device_get_source (dev) != GDK_SOURCE_KEYBOARD)
- continue;
+ GdkWindow *window;
/* Skip non-master keyboards that haven't
* selected for events from this window
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]