[nautilus/wip/antoniof/new-list-view: 12/19] view-icon-controller: Fine-tune click conditionals




commit ddd318e60329706cbc7e339613a73568bdf7d5d4
Author: António Fernandes <antoniof gnome org>
Date:   Sun May 22 17:17:38 2022 +0100

    view-icon-controller: Fine-tune click conditionals
    
    Handle some corner cases in a more sensible way:
    
      - Ignore double-click while "activate on single click" mode is on.
      - Activate on middle-click even if Shift or Ctrl are pressed.
      - Ignore multi-click with secondary button.

 src/nautilus-view-icon-controller.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/nautilus-view-icon-controller.c b/src/nautilus-view-icon-controller.c
index 6ee8cdb7f..eae7584cf 100644
--- a/src/nautilus-view-icon-controller.c
+++ b/src/nautilus-view-icon-controller.c
@@ -832,18 +832,18 @@ 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)
+    if (button == GDK_BUTTON_PRIMARY && n_press == 2 && !self->single_click_mode)
     {
         activate_selection_on_click (self, modifiers & GDK_SHIFT_MASK);
         gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
         self->activate_on_release = FALSE;
     }
-    else if (button == GDK_BUTTON_MIDDLE && n_press == 1 && !selection_mode)
+    else if (button == GDK_BUTTON_MIDDLE && n_press == 1)
     {
         activate_selection_on_click (self, TRUE);
         gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
     }
-    else if (button == GDK_BUTTON_SECONDARY)
+    else if (button == GDK_BUTTON_SECONDARY && n_press == 1)
     {
         nautilus_files_view_pop_up_selection_context_menu (NAUTILUS_FILES_VIEW (self),
                                                            view_x, view_y);


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