[gtk/wip/synthetic-motion2: 22/30] broadway: Fix return value of get_device_state




commit c7813dd54e03d4aae4e08fae03a91f194636069c
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Aug 26 16:24:57 2020 -0400

    broadway: Fix return value of get_device_state
    
    We need to look a the position, not the child surface.

 gdk/broadway/gdksurface-broadway.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/gdk/broadway/gdksurface-broadway.c b/gdk/broadway/gdksurface-broadway.c
index 50769c7155..bb932ee17f 100644
--- a/gdk/broadway/gdksurface-broadway.c
+++ b/gdk/broadway/gdksurface-broadway.c
@@ -750,15 +750,14 @@ gdk_broadway_surface_get_device_state (GdkSurface      *surface,
                                        double          *y,
                                        GdkModifierType *mask)
 {
-  GdkSurface *child;
-
   g_return_val_if_fail (surface == NULL || GDK_IS_SURFACE (surface), FALSE);
 
   if (GDK_SURFACE_DESTROYED (surface))
     return FALSE;
 
-  gdk_broadway_device_query_state (device, surface, &child, x, y, mask);
-  return child != NULL;
+  gdk_broadway_device_query_state (device, surface, NULL, x, y, mask);
+
+  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]