[gtk+] GdkDisplay: Iterate through seats' pointers/keyboards in older grab functions
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GdkDisplay: Iterate through seats' pointers/keyboards in older grab functions
- Date: Wed, 16 Dec 2015 18:48:06 +0000 (UTC)
commit 644fa138c34db5c60688e650ff7dd54d4dce73f1
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Dec 16 19:04:32 2015 +0100
GdkDisplay: Iterate through seats' pointers/keyboards in older grab functions
Instead of using the GdkDeviceManager.
gdk/gdkdisplay.c | 57 +++++++++++++++++++----------------------------------
1 files changed, 21 insertions(+), 36 deletions(-)
---
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index c8dd9b6..9412ce7 100644
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@ -458,28 +458,22 @@ void
gdk_display_pointer_ungrab (GdkDisplay *display,
guint32 time_)
{
- GdkDeviceManager *device_manager;
- GList *devices, *dev;
+ GList *seats, *s;
GdkDevice *device;
g_return_if_fail (GDK_IS_DISPLAY (display));
- device_manager = gdk_display_get_device_manager (display);
- devices = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_MASTER);
+ seats = gdk_display_list_seats (display);
- /* FIXME: Should this be generic to all backends? */
- /* FIXME: What happens with extended devices? */
- for (dev = devices; dev; dev = dev->next)
+ for (s = seats; s; s = s->next)
{
- device = dev->data;
-
- if (gdk_device_get_source (device) != GDK_SOURCE_MOUSE)
- continue;
-
+ device = gdk_seat_get_pointer (s->data);
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
gdk_device_ungrab (device, time_);
+ G_GNUC_END_IGNORE_DEPRECATIONS;
}
- g_list_free (devices);
+ g_list_free (seats);
}
/**
@@ -498,28 +492,22 @@ void
gdk_display_keyboard_ungrab (GdkDisplay *display,
guint32 time)
{
- GdkDeviceManager *device_manager;
- GList *devices, *dev;
+ GList *seats, *s;
GdkDevice *device;
g_return_if_fail (GDK_IS_DISPLAY (display));
- device_manager = gdk_display_get_device_manager (display);
- devices = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_MASTER);
+ seats = gdk_display_list_seats (display);
- /* FIXME: Should this be generic to all backends? */
- /* FIXME: What happens with extended devices? */
- for (dev = devices; dev; dev = dev->next)
+ for (s = seats; s; s = s->next)
{
- device = dev->data;
-
- if (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD)
- continue;
-
+ device = gdk_seat_get_keyboard (s->data);
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
gdk_device_ungrab (device, time);
+ G_GNUC_END_IGNORE_DEPRECATIONS;
}
- g_list_free (devices);
+ g_list_free (seats);
}
/**
@@ -1428,28 +1416,25 @@ gdk_device_grab_info_libgtk_only (GdkDisplay *display,
gboolean
gdk_display_pointer_is_grabbed (GdkDisplay *display)
{
- GdkDeviceManager *device_manager;
- GList *devices, *dev;
+ GList *seats, *s;
GdkDevice *device;
g_return_val_if_fail (GDK_IS_DISPLAY (display), TRUE);
- device_manager = gdk_display_get_device_manager (display);
- devices = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_MASTER);
+ seats = gdk_display_list_seats (display);
- for (dev = devices; dev; dev = dev->next)
+ for (s = seats; s; s = s->next)
{
- device = dev->data;
+ device = gdk_seat_get_pointer (s->data);
- if (gdk_device_get_source (device) == GDK_SOURCE_MOUSE &&
- gdk_display_device_is_grabbed (display, device))
+ if (gdk_display_device_is_grabbed (display, device))
{
- g_list_free (devices);
+ g_list_free (seats);
return TRUE;
}
}
- g_list_free (devices);
+ g_list_free (seats);
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]