[gtk] main: Prefer implicit grab widget to target widget for motion events



commit 1674b6e26913260eb900b6a103b50fd171071888
Author: Timm Bäder <mail baedert org>
Date:   Tue Feb 5 15:13:01 2019 +0100

    main: Prefer implicit grab widget to target widget for motion events
    
    When an implcit grab is going on, we don't need to consider other
    widgets for motion (etc.) events.

 gtk/gtkmain.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index e1bd39dd86..185ffb7c7d 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -1615,9 +1615,14 @@ handle_pointing_event (GdkEvent *event)
     case GDK_TOUCH_BEGIN:
     case GDK_TOUCH_UPDATE:
     case GDK_MOTION_NOTIFY:
-      target = gtk_widget_pick (toplevel_widget, x, y);
-      if (target == NULL)
+      target = gtk_window_lookup_pointer_focus_implicit_grab (toplevel, device, sequence);
+
+      if (!target)
+        target = gtk_widget_pick (toplevel_widget, x, y);
+
+      if (!target)
         target = toplevel_widget;
+
       old_target = update_pointer_focus_state (toplevel, event, target);
 
       if (event->any.type == GDK_MOTION_NOTIFY || event->any.type == GDK_ENTER_NOTIFY)


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