[nautilus] do not switch focus to new tabs



commit 9028e3322f041d06e54f350d97831b6fb3fea9f7
Author: Razvan Chitu <razvan ch95 gmail com>
Date:   Thu Mar 24 23:10:19 2016 +0200

    do not switch focus to new tabs
    
    In Nautilus, when a location is opened in a new tab, the new tab gets
    automatically focused. This behavior is not consistent with other tab-based
    applications, such as browsers - Epiphany, Firefox, Chromium to name a few. It
    is also a regression, since this behavior was not present in 3.14. In order to
    fix this, set a flag so the new tab is not made active.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=764035

 src/nautilus-canvas-view.c  |    1 +
 src/nautilus-files-view.c   |    3 ++-
 src/nautilus-list-view.c    |    1 +
 src/nautilus-mime-actions.c |    1 +
 src/nautilus-places-view.c  |    3 ++-
 src/nautilus-window.c       |    3 ++-
 6 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/nautilus-canvas-view.c b/src/nautilus-canvas-view.c
index 7dc7dca..5e31bc8 100644
--- a/src/nautilus-canvas-view.c
+++ b/src/nautilus-canvas-view.c
@@ -1311,6 +1311,7 @@ canvas_container_activate_alternate_callback (NautilusCanvasContainer *container
 
        if (open_in_tab) {
                flags |= NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB;
+               flags |= NAUTILUS_WINDOW_OPEN_FLAG_DONT_MAKE_ACTIVE;
        }
 
        if (open_in_window) {
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index e233336..0b52d5a 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -1280,7 +1280,8 @@ action_open_item_new_tab (GSimpleAction *action,
         if (nautilus_files_view_confirm_multiple (window, g_list_length (selection), TRUE)) {
                 nautilus_files_view_activate_files (view,
                                               selection,
-                                              NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB,
+                                              NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB |
+                                              NAUTILUS_WINDOW_OPEN_FLAG_DONT_MAKE_ACTIVE,
                                               FALSE);
         }
 
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c
index e8a1b09..1c2f996 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -228,6 +228,7 @@ activate_selected_items_alternate (NautilusListView *view,
 
        if (open_in_tab) {
                flags |= NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB;
+                flags |= NAUTILUS_WINDOW_OPEN_FLAG_DONT_MAKE_ACTIVE;
        } else {
                flags |= NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW;
        }
diff --git a/src/nautilus-mime-actions.c b/src/nautilus-mime-actions.c
index cd750b7..215e8e8 100644
--- a/src/nautilus-mime-actions.c
+++ b/src/nautilus-mime-actions.c
@@ -1643,6 +1643,7 @@ activate_files (ActivateParameters *parameters)
        if (count > 1) {
                if ((parameters->flags & NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW) == 0) {
                        flags |= NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB;
+                        flags |= NAUTILUS_WINDOW_OPEN_FLAG_DONT_MAKE_ACTIVE;
                } else {
                        flags |= NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW;
                }
diff --git a/src/nautilus-places-view.c b/src/nautilus-places-view.c
index b805490..1a01495 100644
--- a/src/nautilus-places-view.c
+++ b/src/nautilus-places-view.c
@@ -65,7 +65,8 @@ open_location_cb (NautilusPlacesView *view,
 
         switch (open_flags) {
         case GTK_PLACES_OPEN_NEW_TAB:
-                flags = NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB;
+                flags = NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB |
+                        NAUTILUS_WINDOW_OPEN_FLAG_DONT_MAKE_ACTIVE;
                 break;
 
         case GTK_PLACES_OPEN_NEW_WINDOW:
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 134f7ac..69823b6 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -915,7 +915,8 @@ open_location_cb (NautilusWindow     *window,
 
        switch (open_flags) {
        case GTK_PLACES_OPEN_NEW_TAB:
-               flags = NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB;
+                flags = NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB |
+                        NAUTILUS_WINDOW_OPEN_FLAG_DONT_MAKE_ACTIVE;
                break;
 
        case GTK_PLACES_OPEN_NEW_WINDOW:


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