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



commit 62ca4ef1185d4464d181969f590950f6459ccca7
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 de5ba11..3841d1a 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -11592,6 +11592,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]