[gtk+] treeview: Don't use GdkDeviceManager
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] treeview: Don't use GdkDeviceManager
- Date: Sat, 25 Nov 2017 16:23:24 +0000 (UTC)
commit 835805ad6147b43f65b120802f12eb6d2ab121a3
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Nov 23 15:40:12 2017 -0500
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
gtk/gtktreeview.c | 17 +++++------------
1 files changed, 5 insertions(+), 12 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 31da0d8..e21ea17 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]