[gtk+] window: Only check for the event widget if clicked on the "content" region



commit 3c0ebf65cf89140825a3f8c4c4e65170f8df4e8a
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Jun 2 18:04:36 2014 +0200

    window: Only check for the event widget if clicked on the "content" region
    
    Every button press/release event reaching the the multipress gesture in GtkWindow
    and happening in the "title" region must be handled, regardless of the event widget.
    Children there wanting the event(s) for themselves are (and were always) expected
    to stop event propagation.
    
    So the only place to check for the event widget's "window-dragging" style property
    is the "content" region, which matches the pre-gestures behavior.
    
    This fixes some issues with sequences being mistakenly claimed (and events not
    propagated further) on situations it shouldn't.

 gtk/gtkwindow.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 604fece..06c7592 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -1435,15 +1435,15 @@ multipress_gesture_pressed_cb (GtkGestureMultiPress *gesture,
       if (event_widget != widget)
         gtk_widget_style_get (event_widget, "window-dragging",
                               &window_drag, NULL);
-      /* fall thru */
-    case GTK_WINDOW_REGION_TITLE:
-      if (!window_drag && event_widget != widget)
+
+      if (!window_drag)
         {
           gtk_gesture_set_sequence_state (GTK_GESTURE (gesture),
                                           sequence, GTK_EVENT_SEQUENCE_DENIED);
           return;
         }
-
+      /* fall thru */
+    case GTK_WINDOW_REGION_TITLE:
       if (n_press == 2)
         _gtk_window_toggle_maximized (window);
       /* fall thru */


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