[gtk/matthiasc/for-master: 14/18] wayland: Fix return value of get_device_state
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/matthiasc/for-master: 14/18] wayland: Fix return value of get_device_state
- Date: Wed, 26 Aug 2020 21:17:36 +0000 (UTC)
commit d0560660b610eeaaca4db994254ebe7b9bc29bb1
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Aug 26 16:32:31 2020 -0400
wayland: Fix return value of get_device_state
We need to look a the position, not the child surface.
gdk/wayland/gdksurface-wayland.c | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)
---
diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c
index b6ff57a5b0..45769984ea 100644
--- a/gdk/wayland/gdksurface-wayland.c
+++ b/gdk/wayland/gdksurface-wayland.c
@@ -3170,21 +3170,12 @@ gdk_wayland_surface_get_device_state (GdkSurface *surface,
double *y,
GdkModifierType *mask)
{
- gboolean return_val;
-
- g_return_val_if_fail (surface == NULL || GDK_IS_SURFACE (surface), FALSE);
-
- return_val = TRUE;
-
- if (!GDK_SURFACE_DESTROYED (surface))
- {
- GdkSurface *child;
+ if (GDK_SURFACE_DESTROYED (surface))
+ return FALSE;
- gdk_wayland_device_query_state (device, surface, &child, x, y, mask);
- return_val = (child != NULL);
- }
+ gdk_wayland_device_query_state (device, surface, NULL, x, y, mask);
- return return_val;
+ return *x >= 0 && *y >= 0 && *x < surface->width && *y < surface->height;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]