[gtk+/wip/carlosg/event-delivery: 49/105] gtkwindow: Ignore implicit grabs going away if there is no focus



commit 4b5bc3ae3e9e7887a6532a55ae81d9015942823a
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Apr 1 22:41:23 2017 +0200

    gtkwindow: Ignore implicit grabs going away if there is no focus
    
    There should be no circumstances where an implicit grab is requested but
    no focus exists, there's however circumstances (like windowing grabs taking
    input to a different window) where we might get implicit grabs being undone
    when then new window didn't create a focus for the pointer itself.

 gtk/gtkwindow.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index f0e8f07..5868265 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -11507,6 +11507,8 @@ gtk_window_set_pointer_focus_grab (GtkWindow        *window,
   GtkPointerFocus *focus;
 
   focus = gtk_window_lookup_pointer_focus (window, device, sequence);
+  if (!focus && !grab_widget)
+    return;
   g_assert (focus != NULL);
   gtk_pointer_focus_set_implicit_grab (focus, grab_widget);
 }


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