[gtk/wip/carlosg/input-fixes: 4/7] gtkwindow: Correct device check



commit d104efe06e2af085e2bf14f6cd51bbfb0d707f1e
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Apr 24 23:04:27 2020 +0200

    gtkwindow: Correct device check
    
    This function to revoke implicit grabs may be called with a NULL
    device, which means all devices should be revoked. Fix the check
    so this actually happens.
    
    Fixes implicit grabs (maybe) being unset in result to a GTK grab.

 gtk/gtkwindow.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 6347ed6b64..49726ea322 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -7989,7 +7989,7 @@ gtk_window_maybe_revoke_implicit_grab (GtkWindow *window,
       if (focus->toplevel != window)
         continue;
 
-      if (device && focus->device == device &&
+      if ((!device || focus->device == device) &&
           focus->target != grab_widget &&
           !gtk_widget_is_ancestor (focus->target, grab_widget))
         gtk_window_set_pointer_focus_grab (window,


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