[gtk: 1/2] GtkTreeExpander: claim expander-icon gestures




commit 318160d836ef27881b2d93de9548e54cc288e14a
Author: Jan Lukas Gernert <jangernert gmail com>
Date:   Wed Aug 25 17:50:12 2021 +0200

    GtkTreeExpander: claim expander-icon gestures
    
    Claim the pressed, released and canceled gestures
    meant for the expander-icon of the TreeExpander.
    This avoids selecting the row when expanding or collapsing it.
    
    Closes #4199

 gtk/gtktreeexpander.c | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/gtk/gtktreeexpander.c b/gtk/gtktreeexpander.c
index a13c2400b4..2b4e8b415d 100644
--- a/gtk/gtktreeexpander.c
+++ b/gtk/gtktreeexpander.c
@@ -119,6 +119,8 @@ gtk_tree_expander_click_gesture_pressed (GtkGestureClick *gesture,
   gtk_widget_set_state_flags (widget,
                               GTK_STATE_FLAG_ACTIVE,
                               FALSE);
+
+  gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
 }
 
 static void
@@ -130,6 +132,8 @@ gtk_tree_expander_click_gesture_released (GtkGestureClick *gesture,
 {
   gtk_widget_unset_state_flags (gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (gesture)),
                                 GTK_STATE_FLAG_ACTIVE);
+
+  gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
 }
 
 static void
@@ -139,6 +143,8 @@ gtk_tree_expander_click_gesture_canceled (GtkGestureClick  *gesture,
 {
   gtk_widget_unset_state_flags (gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (gesture)),
                                 GTK_STATE_FLAG_ACTIVE);
+
+  gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
 }
 
 static void


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