summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-08-26 16:20:34 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-08-26 17:56:41 -0400
commitcf257e667608c73efb56cae498bebcde1daacc6f (patch)
treefd5416c0709951350e020a3532f6ab354a02d557
parent62ed769e74ef1b07144b6813b1b2b84e787e1c8f (diff)
downloadgtk+-cf257e667608c73efb56cae498bebcde1daacc6f.tar.gz
x11: Fix return value of get_device_state
We need to look a the position, not the child surface.
-rw-r--r--gdk/x11/gdksurface-x11.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/gdk/x11/gdksurface-x11.c b/gdk/x11/gdksurface-x11.c
index 2c3cdf86b4..d7ed8d034a 100644
--- a/gdk/x11/gdksurface-x11.c
+++ b/gdk/x11/gdksurface-x11.c
@@ -2659,19 +2659,18 @@ gdk_x11_surface_get_frame_extents (GdkSurface *surface,
}
static gboolean
-gdk_x11_surface_get_device_state (GdkSurface *surface,
- GdkDevice *device,
- double *x,
- double *y,
- GdkModifierType *mask)
+gdk_x11_surface_get_device_state (GdkSurface *surface,
+ GdkDevice *device,
+ double *x,
+ double *y,
+ GdkModifierType *mask)
{
- GdkSurface *child;
-
if (GDK_SURFACE_DESTROYED (surface))
return FALSE;
- gdk_x11_device_xi2_query_state (device, surface, &child, x, y, mask);
- return child != NULL;
+ gdk_x11_device_xi2_query_state (device, surface, NULL, x, y, mask);
+
+ return *x >= 0 && *y >= 0 && *x < surface->width && *y < surface->height;
}
static void