From e1d37e8706291c535ad8db3bb56c0d77f5fb3f1c Mon Sep 17 00:00:00 2001 From: Ondrej Holy Date: Wed, 5 Apr 2023 13:27:39 +0200 Subject: [PATCH] Try current location even if it is marked as gone Resolves: rhbz#2184292 --- nautilus.spec | 8 ++- ...current-location-even-if-it-is-marke.patch | 72 +++++++++++++++++++ 2 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 window-slot-Try-current-location-even-if-it-is-marke.patch diff --git a/nautilus.spec b/nautilus.spec index 135c2e7..8829aff 100644 --- a/nautilus.spec +++ b/nautilus.spec @@ -6,7 +6,7 @@ Name: nautilus Version: 40.2 -Release: 11%{?dist} +Release: 12%{?dist} Summary: File manager for GNOME License: GPLv3+ @@ -39,6 +39,9 @@ Patch13: Revert-freedesktop-dbus-Defer-D-Bus-property-setting.patch Patch14: application-Export-FileManager1-iface-from-dbus_regi.patch Patch15: freedesktop-dbus-Try-to-own-the-name-until-after-exp.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=2184292 +Patch16: window-slot-Try-current-location-even-if-it-is-marke.patch + BuildRequires: desktop-file-utils BuildRequires: gcc BuildRequires: gettext @@ -169,6 +172,9 @@ desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/*.desktop %doc %{_datadir}/gtk-doc/html/libnautilus-extension/ %changelog +* Wed Apr 05 2023 Ondrej Holy - 40.2-12 +- Try current location even if it is marked as gone (#2184292) + * Thu Feb 23 2023 Ondrej Holy - 40.2-11 - Try to own the name until after exporting skeleton (#2162302) diff --git a/window-slot-Try-current-location-even-if-it-is-marke.patch b/window-slot-Try-current-location-even-if-it-is-marke.patch new file mode 100644 index 0000000..768afdd --- /dev/null +++ b/window-slot-Try-current-location-even-if-it-is-marke.patch @@ -0,0 +1,72 @@ +From b0e28bc19c065b4bc1d6fdea922ae2c09115b0e6 Mon Sep 17 00:00:00 2001 +From: Ondrej Holy +Date: Tue, 24 Jan 2023 12:13:15 +0100 +Subject: [PATCH] window-slot: Try current location even if it is marked as + gone + +When the current location is marked as gone, Nautilus jumps to the +first existing parent currently (except for non-native locations and +mount roots). This is fine in most cases, but not for autofs locations +as Nautilus jumps to parent everytime autofs mount timeouted. It would +be better to stay in the same folder in this case. Let's try the current +location first even if it is marked as gone to ensure that. It would be +perhaps even better to prevent autofs locations somehow from timeouting +at all, or avoid immediate remounting at least, but those solutions +don't look easy to implement. + +Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/1514 +--- + src/nautilus-window-slot.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c +index c06dc3432..a1af61887 100644 +--- a/src/nautilus-window-slot.c ++++ b/src/nautilus-window-slot.c +@@ -1442,11 +1442,10 @@ viewed_file_changed_callback (NautilusFile *file, + if (priv->viewed_file_seen) + { + GFile *go_to_file; +- GFile *parent; + GFile *location; + GMount *mount; ++ gboolean find_existing = FALSE; + +- parent = NULL; + location = nautilus_file_get_location (file); + + if (g_file_is_native (location)) +@@ -1455,16 +1454,18 @@ viewed_file_changed_callback (NautilusFile *file, + + if (mount == NULL) + { +- parent = g_file_get_parent (location); ++ find_existing = TRUE; + } + + g_clear_object (&mount); + } + +- if (parent != NULL) ++ if (find_existing) + { +- /* auto-show existing parent */ +- go_to_file = nautilus_find_existing_uri_in_hierarchy (parent); ++ /* Verify also the current location to prevent jumps to parent ++ * in case of autofs. ++ */ ++ go_to_file = nautilus_find_existing_uri_in_hierarchy (location); + } + else + { +@@ -1473,7 +1474,6 @@ viewed_file_changed_callback (NautilusFile *file, + + nautilus_window_slot_open_location_full (self, go_to_file, 0, NULL); + +- g_clear_object (&parent); + g_object_unref (go_to_file); + g_object_unref (location); + } +-- +2.39.2 +