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



commit 95bf1379c061c69c8bdd42f7d155a5f245e03b5a
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]