summaryrefslogtreecommitdiff
path: root/gdk/gdkdisplay.c
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2020-07-30 14:26:51 +0200
committerCarlos Garnacho <carlosg@gnome.org>2020-07-30 18:17:42 +0200
commit94982dbab7189eab96c2f2a6e91427efd7e68b1f (patch)
treed376d457be3a24096c0f0567df541bf13e6223a5 /gdk/gdkdisplay.c
parent4dc2ab61c9f2266ffda1e6fedac36969ebc309ff (diff)
downloadgtk+-94982dbab7189eab96c2f2a6e91427efd7e68b1f.tar.gz
gdk: Avoid gdk_device_get_associated_device()
Query the seat for that.
Diffstat (limited to 'gdk/gdkdisplay.c')
-rw-r--r--gdk/gdkdisplay.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index 7d8d7cb9ac..14abf69c73 100644
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@ -816,9 +816,15 @@ _gdk_display_get_pointer_info (GdkDisplay *display,
GdkDevice *device)
{
GdkPointerSurfaceInfo *info;
+ GdkSeat *seat;
- if (device && gdk_device_get_source (device) == GDK_SOURCE_KEYBOARD)
- device = gdk_device_get_associated_device (device);
+ if (device)
+ {
+ seat = gdk_device_get_seat (device);
+
+ if (device == gdk_seat_get_keyboard (seat))
+ device = gdk_seat_get_pointer (seat);
+ }
if (G_UNLIKELY (!device))
return NULL;