[gtk/wip/exalm/treeview-click] treeview: Don't handle clicks on any child widgets




commit 13bf7e62b979619ba9813bcb297ec4b210a1d9af
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Wed Jun 2 13:45:11 2021 +0500

    treeview: Don't handle clicks on any child widgets
    
    We already skip them on the edited cell widget, but it's also a problem for
    header buttons. Overall, there's no real reason to let it propagate here.
    
    Fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3996

 gtk/gtktreeview.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 5ee23dea7c..6282ce45ca 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -2767,10 +2767,13 @@ gtk_tree_view_click_gesture_pressed (GtkGestureClick *gesture,
   gboolean rtl;
   GtkWidget *target;
 
-  /* check if this is a click in an editing widget */
+  /* check if this is a click in a child widget */
   target = gtk_event_controller_get_target (GTK_EVENT_CONTROLLER (gesture));
-  if (priv->edited_column && gtk_widget_is_ancestor (target, widget))
+  if (gtk_widget_is_ancestor (target, widget)) {
+    gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_DENIED);
+
     return;
+  }
 
   gtk_tree_view_stop_editing (tree_view, FALSE);
   button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture));


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