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



commit 165afcb311febf5868bd63a96a5d572b3848b90e
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 e6eb2b4..237597e 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -11509,6 +11509,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]