[gtk/wip/carlosg/windowhandle-gesture-state] gtkwindowhandle: Only claim gesture on action



commit 35d2539ef802f029fbcc1c27df3716f3fbad5840
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Jul 13 15:44:58 2020 +0200

    gtkwindowhandle: Only claim gesture on action
    
    The press gesture does not need to set claimed state just for n-press
    tracking, it will however reset all other click gestures on each press
    if the event gets propagated all the way up.
    
    Fixes tracking of multi-press in gestures in widgets that are children
    of the window handle. E.g. the headerbar listview in the "File browser"
    gtk4-demo demo.

 gtk/gtkwindowhandle.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkwindowhandle.c b/gtk/gtkwindowhandle.c
index 3d28d28b2f..437a13c7c6 100644
--- a/gtk/gtkwindowhandle.c
+++ b/gtk/gtkwindowhandle.c
@@ -351,10 +351,11 @@ click_gesture_pressed_cb (GtkGestureClick *gesture,
     {
     case GDK_BUTTON_PRIMARY:
       if (n_press == 2)
-        perform_titlebar_action (self, event, button, n_press);
-
-      gtk_gesture_set_sequence_state (GTK_GESTURE (gesture),
-                                      sequence, GTK_EVENT_SEQUENCE_CLAIMED);
+        {
+          perform_titlebar_action (self, event, button, n_press);
+          gtk_gesture_set_sequence_state (GTK_GESTURE (gesture),
+                                          sequence, GTK_EVENT_SEQUENCE_CLAIMED);
+        }
       break;
 
     case GDK_BUTTON_SECONDARY:


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