[nautilus/wip/antoniof/new-view-event-bugfixes: 2/3] list-base: Ignore double-click while holding Shift or Ctrl




commit 93fa539e4b5d9869e1d63c34da462520c001f97a
Author: António Fernandes <antoniof gnome org>
Date:   Wed Jun 22 10:51:56 2022 +0100

    list-base: Ignore double-click while holding Shift or Ctrl
    
    Double clicking an item while holding down Shift can result in opening
    a bunch of files in a go, because it selects an interval right before
    triggering activation.
    
    This is obviously undersirable, especially if people expect the that
    holding down the modifier would actually modify the double click action
    to open in a new window or tab (the old canvas view used to do just
    that, but that behaviro was inconsistent with the list view anyway).
    
    The safe thing to do here is nothing. Just ignoring the double-click
    if Shift or Ctrl are pressed.

 src/nautilus-list-base.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/nautilus-list-base.c b/src/nautilus-list-base.c
index 386c41ca3..fa2707470 100644
--- a/src/nautilus-list-base.c
+++ b/src/nautilus-list-base.c
@@ -312,9 +312,10 @@ on_item_click_pressed (GtkGestureClick *gesture,
 
     /* It's safe to claim event sequence on press in the following cases because
      * they don't interfere with touch scrolling. */
-    if (button == GDK_BUTTON_PRIMARY && n_press == 2 && !priv->single_click_mode)
+    if (button == GDK_BUTTON_PRIMARY && n_press == 2 &&
+        !priv->single_click_mode && !selection_mode)
     {
-        activate_selection_on_click (self, modifiers & GDK_SHIFT_MASK);
+        activate_selection_on_click (self, FALSE);
         gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
     }
     else if (button == GDK_BUTTON_MIDDLE && n_press == 1)


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