[gtk+/gestures: 10/13] gtk: Remove propagation limit of captured events on the grab widget



commit 95f8a425ab91d4e8808bbdb63adb73e53c1b5a6b
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Feb 24 14:51:27 2014 +0100

    gtk: Remove propagation limit of captured events on the grab widget
    
    Now, all captured events run from the toplevel to the deepmost widget,
    regardless of GTK+ grabs. This makes captured events more useful to
    event controllers if used together in the hierarchy with widgets doing
    old fashioned event handling and GTK+ grabs.

 gtk/gtkmain.c |   17 ++++-------------
 1 files changed, 4 insertions(+), 13 deletions(-)
---
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index c3367e1..0521538 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -1496,7 +1496,6 @@ gtk_main_do_event (GdkEvent *event)
 {
   GtkWidget *event_widget;
   GtkWidget *grab_widget = NULL;
-  GtkWidget *topmost_widget = NULL;
   GtkWindowGroup *window_group;
   GdkEvent *rewritten_event = NULL;
   GdkDevice *device;
@@ -1562,14 +1561,6 @@ gtk_main_do_event (GdkEvent *event)
   if (!grab_widget)
     grab_widget = gtk_window_group_get_current_grab (window_group);
 
-  /* Find out the topmost widget where captured event propagation
-   * should start, which is the widget holding the GTK+ grab
-   * if any, otherwise it's left NULL and events are emitted
-   * from the toplevel (or topmost parentless parent).
-   */
-  if (grab_widget)
-    topmost_widget = grab_widget;
-
   /* If the grab widget is an ancestor of the event widget
    * then we send the event to the original event widget.
    * This is the key to implementing modality.
@@ -1683,7 +1674,7 @@ gtk_main_do_event (GdkEvent *event)
     case GDK_2BUTTON_PRESS:
     case GDK_3BUTTON_PRESS:
     case GDK_TOUCH_BEGIN:
-      if (!_gtk_propagate_captured_event (grab_widget, event, topmost_widget))
+      if (!_gtk_propagate_captured_event (grab_widget, event, NULL))
         gtk_propagate_event (grab_widget, event);
       break;
 
@@ -1731,7 +1722,7 @@ gtk_main_do_event (GdkEvent *event)
     case GDK_TOUCH_UPDATE:
     case GDK_TOUCH_END:
     case GDK_TOUCH_CANCEL:
-      if (!_gtk_propagate_captured_event (grab_widget, event, topmost_widget))
+      if (!_gtk_propagate_captured_event (grab_widget, event, NULL))
         gtk_propagate_event (grab_widget, event);
       break;
 
@@ -1742,7 +1733,7 @@ gtk_main_do_event (GdkEvent *event)
                                        gdk_event_get_device (event),
                                        event->any.window);
       if (gtk_widget_is_sensitive (grab_widget) &&
-          !_gtk_propagate_captured_event (grab_widget, event, topmost_widget))
+          !_gtk_propagate_captured_event (grab_widget, event, NULL))
         gtk_widget_event (grab_widget, event);
       break;
 
@@ -1753,7 +1744,7 @@ gtk_main_do_event (GdkEvent *event)
                                        gdk_event_get_device (event),
                                        NULL);
       if (gtk_widget_is_sensitive (grab_widget) &&
-          !_gtk_propagate_captured_event (grab_widget, event, topmost_widget))
+          !_gtk_propagate_captured_event (grab_widget, event, NULL))
         gtk_widget_event (grab_widget, event);
       break;
 


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