[gtk/wip/carlosg/cursor-fallout] gdk: Fix toplevel calculation on pointer grab switch




commit 9564cba4928f9fb7bf3b6dc1ed275e9ad617adf8
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Jul 31 18:46:47 2020 +0200

    gdk: Fix toplevel calculation on pointer grab switch
    
    This check used to read if (grab || device_type != GDK_DEVICE_TYPE_PHYSICAL),
    the grab check was only reserved to physical devices, which the current
    pointer device definitely doesn't act like. So the condition was "fixed" the
    wrong way around, and the latter check is now moot, so the condition should
    really go away. We always want to check the new toplevel under the pointer
    here.
    
    Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2970

 gdk/gdkdisplay.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index c24d1216be..c353c9de50 100644
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@ -639,8 +639,7 @@ switch_to_pointer_grab (GdkDisplay        *display,
       if (grab == NULL /* ungrab */ ||
          (!last_grab->owner_events && grab->owner_events) /* switched to owner_events */ )
        {
-          if (grab)
-            new_toplevel = get_current_toplevel (display, device, &x, &y, &state);
+          new_toplevel = get_current_toplevel (display, device, &x, &y, &state);
 
          if (new_toplevel)
            {


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