[nautilus/wip/ernestask/gtk4-continued] list-view: Fix secondary-click selection



commit 9d9e20223748270e2a538a88cbee43caeee0d203
Author: Ernestas Kulik <ernestask gnome org>
Date:   Mon Aug 13 11:49:22 2018 +0300

    list-view: Fix secondary-click selection
    
    Previously, the code would chain up to the parent button_press_event(),
    which is impossible with the introduction of gestures. A workaround for
    that is just unselecting everything and selecting the path that is
    underneath the pointer.

 src/nautilus-list-view.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)
---
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c
index 2dccb5959..263470195 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -840,15 +840,8 @@ on_tree_view_multi_press_gesture_pressed (GtkGestureMultiPress *gesture,
         /* Needed to select an item before popping up a menu. */
         if (call_parent)
         {
-#if 0
-            GtkWidgetClass *tree_view_class;
-
-            tree_view_class = GTK_WIDGET_GET_CLASS (tree_view);
-
-            g_signal_handlers_block_by_func (tree_view, row_activated_callback, view);
-            tree_view_class->button_press_event (widget, (GdkEventButton *) event);
-            g_signal_handlers_unblock_by_func (tree_view, row_activated_callback, view);
-#endif
+            gtk_tree_selection_unselect_all (selection);
+            gtk_tree_selection_select_path (selection, path);
         }
         else if (path_selected)
         {


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