[gtk/columnview-double-activation: 9/9] listitemwidget: Claim gesture when activating




commit 276f85c9e3639f9675d0dcc369ea88bf026dde58
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Jun 13 08:03:39 2021 -0400

    listitemwidget: Claim gesture when activating
    
    Claim the gesture when we are activating a list item.
    
    Otherwise we end up with double activations in
    columnviews: first GtkColumnViewCell handles
    the event, and then GtkListItemWidget handles
    it again.
    
    Fixes: #4015

 gtk/gtklistitemwidget.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/gtk/gtklistitemwidget.c b/gtk/gtklistitemwidget.c
index bbf56b7293..0c9baea963 100644
--- a/gtk/gtklistitemwidget.c
+++ b/gtk/gtklistitemwidget.c
@@ -334,6 +334,7 @@ gtk_list_item_widget_click_gesture_pressed (GtkGestureClick   *gesture,
     {
       if (n_press == 2 && !priv->single_click_activate)
         {
+          gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
           gtk_widget_activate_action (GTK_WIDGET (self),
                                       "list.activate-item",
                                       "u",
@@ -360,6 +361,7 @@ gtk_list_item_widget_click_gesture_released (GtkGestureClick   *gesture,
     {
       if (n_press == 1 && priv->single_click_activate)
         {
+          gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
           gtk_widget_activate_action (GTK_WIDGET (self),
                                       "list.activate-item",
                                       "u",


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