mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-13 04:10:13 +00:00
GdkWindow: Iterate through seats' pointers/keyboards in older grab functions
Instead of using the GdkDeviceManager.
This commit is contained in:
parent
7a926cc7e0
commit
ce7bb7c739
@ -8242,11 +8242,10 @@ gdk_pointer_grab (GdkWindow * window,
|
|||||||
{
|
{
|
||||||
GdkWindow *native;
|
GdkWindow *native;
|
||||||
GdkDisplay *display;
|
GdkDisplay *display;
|
||||||
GdkDeviceManager *device_manager;
|
|
||||||
GdkDevice *device;
|
GdkDevice *device;
|
||||||
GdkGrabStatus res = 0;
|
GdkGrabStatus res = 0;
|
||||||
gulong serial;
|
gulong serial;
|
||||||
GList *devices, *dev;
|
GList *seats, *s;
|
||||||
|
|
||||||
g_return_val_if_fail (window != NULL, GDK_GRAB_FAILED);
|
g_return_val_if_fail (window != NULL, GDK_GRAB_FAILED);
|
||||||
g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_GRAB_FAILED);
|
g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_GRAB_FAILED);
|
||||||
@ -8283,17 +8282,11 @@ gdk_pointer_grab (GdkWindow * window,
|
|||||||
display = gdk_window_get_display (window);
|
display = gdk_window_get_display (window);
|
||||||
|
|
||||||
serial = _gdk_display_get_next_serial (display);
|
serial = _gdk_display_get_next_serial (display);
|
||||||
device_manager = gdk_display_get_device_manager (display);
|
seats = gdk_display_list_seats (display);
|
||||||
devices = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_MASTER);
|
|
||||||
|
|
||||||
/* FIXME: Should this be generic to all backends? */
|
for (s = seats; s; s = s->next)
|
||||||
/* FIXME: What happens with extended devices? */
|
|
||||||
for (dev = devices; dev; dev = dev->next)
|
|
||||||
{
|
{
|
||||||
device = dev->data;
|
device = gdk_seat_get_pointer (s->data);
|
||||||
|
|
||||||
if (gdk_device_get_source (device) != GDK_SOURCE_MOUSE)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
res = GDK_DEVICE_GET_CLASS (device)->grab (device,
|
res = GDK_DEVICE_GET_CLASS (device)->grab (device,
|
||||||
native,
|
native,
|
||||||
@ -8318,7 +8311,7 @@ gdk_pointer_grab (GdkWindow * window,
|
|||||||
|
|
||||||
/* FIXME: handle errors when grabbing */
|
/* FIXME: handle errors when grabbing */
|
||||||
|
|
||||||
g_list_free (devices);
|
g_list_free (seats);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@ -8354,11 +8347,10 @@ gdk_keyboard_grab (GdkWindow *window,
|
|||||||
{
|
{
|
||||||
GdkWindow *native;
|
GdkWindow *native;
|
||||||
GdkDisplay *display;
|
GdkDisplay *display;
|
||||||
GdkDeviceManager *device_manager;
|
|
||||||
GdkDevice *device;
|
GdkDevice *device;
|
||||||
GdkGrabStatus res = 0;
|
GdkGrabStatus res = 0;
|
||||||
gulong serial;
|
gulong serial;
|
||||||
GList *devices, *dev;
|
GList *seats, *s;
|
||||||
|
|
||||||
g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_GRAB_FAILED);
|
g_return_val_if_fail (GDK_IS_WINDOW (window), GDK_GRAB_FAILED);
|
||||||
|
|
||||||
@ -8383,17 +8375,11 @@ gdk_keyboard_grab (GdkWindow *window,
|
|||||||
|
|
||||||
display = gdk_window_get_display (window);
|
display = gdk_window_get_display (window);
|
||||||
serial = _gdk_display_get_next_serial (display);
|
serial = _gdk_display_get_next_serial (display);
|
||||||
device_manager = gdk_display_get_device_manager (display);
|
seats = gdk_display_list_seats (display);
|
||||||
devices = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_MASTER);
|
|
||||||
|
|
||||||
/* FIXME: Should this be generic to all backends? */
|
for (s = seats; s; s = s->next)
|
||||||
/* FIXME: What happens with extended devices? */
|
|
||||||
for (dev = devices; dev; dev = dev->next)
|
|
||||||
{
|
{
|
||||||
device = dev->data;
|
device = gdk_seat_get_keyboard (s->data);
|
||||||
|
|
||||||
if (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
res = GDK_DEVICE_GET_CLASS (device)->grab (device,
|
res = GDK_DEVICE_GET_CLASS (device)->grab (device,
|
||||||
native,
|
native,
|
||||||
@ -8417,7 +8403,7 @@ gdk_keyboard_grab (GdkWindow *window,
|
|||||||
|
|
||||||
/* FIXME: handle errors when grabbing */
|
/* FIXME: handle errors when grabbing */
|
||||||
|
|
||||||
g_list_free (devices);
|
g_list_free (seats);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user