[gtk/matthiasc/for-master: 16/18] win32: Fix return value of get_device_state




commit 618891a41a5e8b8fc2064d8d2f5850862fc54683
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Aug 26 16:35:28 2020 -0400

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

 gdk/win32/gdksurface-win32.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)
---
diff --git a/gdk/win32/gdksurface-win32.c b/gdk/win32/gdksurface-win32.c
index 4708ea7935..33a279f8e1 100644
--- a/gdk/win32/gdksurface-win32.c
+++ b/gdk/win32/gdksurface-win32.c
@@ -1724,19 +1724,16 @@ gdk_win32_surface_get_root_coords (GdkSurface *window,
 }
 
 static gboolean
-gdk_surface_win32_get_device_state (GdkSurface       *window,
-                                   GdkDevice       *device,
-                                   double          *x,
-                                   double          *y,
-                                   GdkModifierType *mask)
+gdk_surface_win32_get_device_state (GdkSurface     *window,
+                                    GdkDevice       *device,
+                                    double          *x,
+                                    double          *y,
+                                    GdkModifierType *mask)
 {
-  GdkSurface *child;
+  _gdk_device_win32_query_state (device, window, NULL, x, y, mask);
 
-  g_return_val_if_fail (window == NULL || GDK_IS_SURFACE (window), FALSE);
+  return *x >= 0 && *y >= 0 && *x < window->width && *y < window->height;
 
-  _gdk_device_win32_query_state (device, window, &child, x, y, mask);
-
-  return (child != NULL);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]