Compare commits

...

No commits in common. "imports/c8s/nautilus-3.28.1-15.el8" and "c8" have entirely different histories.

17 changed files with 3153 additions and 2 deletions

View File

@ -1 +0,0 @@
f5fb5185ad922f906a22bc0aeae4cc76a243200d SOURCES/nautilus-3.28.1.tar.xz

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,93 @@
From 5b40335c34a3b920348633274a03d073d1338a09 Mon Sep 17 00:00:00 2001
From: Ondrej Holy <oholy@redhat.com>
Date: Mon, 9 Jan 2023 13:12:17 +0100
Subject: [PATCH] Revert "application: add common startup code"
This reverts commit 23ae53870a39afe43548111b6432db39511a6e97. This
change was needed for split of desktop-related functionality, but it
seems no more needed to me. Let's revert those changes to make the
code a bit easier as a preparation for the next commits.
---
src/nautilus-application.c | 31 ++++++-------------------------
src/nautilus-application.h | 1 -
2 files changed, 6 insertions(+), 26 deletions(-)
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index 22a01ad..829faa3 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -1250,9 +1250,10 @@ on_application_shutdown (GApplication *application,
nautilus_icon_info_clear_caches ();
}
-void
-nautilus_application_startup_common (NautilusApplication *self)
+static void
+nautilus_application_startup (GApplication *app)
{
+ NautilusApplication *self = NAUTILUS_APPLICATION (app);
NautilusApplicationPrivate *priv;
nautilus_profile_start (NULL);
@@ -1269,6 +1270,9 @@ nautilus_application_startup_common (NautilusApplication *self)
setup_theme_extensions ();
+ /* create DBus manager */
+ priv->fdb_manager = nautilus_freedesktop_dbus_new ();
+
/* initialize preferences and create the global GSettings objects */
nautilus_global_preferences_init ();
@@ -1295,22 +1299,6 @@ nautilus_application_startup_common (NautilusApplication *self)
g_signal_connect (self, "shutdown", G_CALLBACK (on_application_shutdown), NULL);
}
-static void
-nautilus_application_startup (GApplication *app)
-{
- NautilusApplication *self = NAUTILUS_APPLICATION (app);
- NautilusApplicationPrivate *priv;
-
- nautilus_profile_start (NULL);
- priv = nautilus_application_get_instance_private (self);
-
- /* create DBus manager */
- priv->fdb_manager = nautilus_freedesktop_dbus_new ();
- nautilus_application_startup_common (self);
-
- nautilus_profile_end (NULL);
-}
-
static gboolean
nautilus_application_dbus_register (GApplication *app,
GDBusConnection *connection,
@@ -1374,13 +1362,6 @@ update_dbus_opened_locations (NautilusApplication *self)
priv = nautilus_application_get_instance_private (self);
- /* Children of nautilus application could not handle the dbus, so don't
- * do anything in that case */
- if (!priv->fdb_manager)
- {
- return;
- }
-
for (l = priv->windows; l != NULL; l = l->next)
{
window = l->data;
diff --git a/src/nautilus-application.h b/src/nautilus-application.h
index 197a276..5f15f06 100644
--- a/src/nautilus-application.h
+++ b/src/nautilus-application.h
@@ -88,7 +88,6 @@ GtkWidget * nautilus_application_connect_server (NautilusApplication *applicatio
void nautilus_application_search (NautilusApplication *application,
const gchar *uri,
const gchar *text);
-void nautilus_application_startup_common (NautilusApplication *application);
G_END_DECLS
#endif /* __NAUTILUS_APPLICATION_H__ */
--
2.38.1

View File

@ -0,0 +1,304 @@
From 1fa3039c67671fe53416b2575f3c305029ef4854 Mon Sep 17 00:00:00 2001
From: Ondrej Holy <oholy@redhat.com>
Date: Wed, 11 Jan 2023 09:55:41 +0100
Subject: [PATCH] application: Export FileManager1 iface from dbus_register
vfunc
The `org/freedesktop/FileManager1` interface is not currently exported
from the `dbus_register` vfunc. This causes issues for projects (e.g.
desktop-icons extension) that want to use all the Nautilus intefaces
over the `org.gnome.Nautilus` connection. Let's use the already established
connection and export the `FileManager1` interface from the `dbus_register`
vfunc.
https://bugzilla.redhat.com/show_bug.cgi?id=2150894
---
src/nautilus-application.c | 17 ++--
src/nautilus-freedesktop-dbus.c | 150 +++++++++++++++++++++++++-------
src/nautilus-freedesktop-dbus.h | 6 +-
3 files changed, 136 insertions(+), 37 deletions(-)
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index 829faa3..3bb3da1 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -608,8 +608,6 @@ nautilus_application_finalize (GObject *object)
g_clear_object (&priv->progress_handler);
g_clear_object (&priv->bookmark_list);
- g_clear_object (&priv->fdb_manager);
-
g_list_free (priv->windows);
g_hash_table_destroy (priv->notifications);
@@ -1270,9 +1268,6 @@ nautilus_application_startup (GApplication *app)
setup_theme_extensions ();
- /* create DBus manager */
- priv->fdb_manager = nautilus_freedesktop_dbus_new ();
-
/* initialize preferences and create the global GSettings objects */
nautilus_global_preferences_init ();
@@ -1315,6 +1310,12 @@ nautilus_application_dbus_register (GApplication *app,
return FALSE;
}
+ priv->fdb_manager = nautilus_freedesktop_dbus_new (connection);
+ if (!nautilus_freedesktop_dbus_register (priv->fdb_manager, error))
+ {
+ return FALSE;
+ }
+
priv->search_provider = nautilus_shell_search_provider_new ();
if (!nautilus_shell_search_provider_register (priv->search_provider, connection, error))
{
@@ -1339,6 +1340,12 @@ nautilus_application_dbus_unregister (GApplication *app,
g_clear_object (&priv->dbus_manager);
}
+ if (priv->fdb_manager)
+ {
+ nautilus_freedesktop_dbus_unregister (priv->fdb_manager);
+ g_clear_object (&priv->fdb_manager);
+ }
+
if (priv->search_provider)
{
nautilus_shell_search_provider_unregister (priv->search_provider);
diff --git a/src/nautilus-freedesktop-dbus.c b/src/nautilus-freedesktop-dbus.c
index b888099..d013e20 100644
--- a/src/nautilus-freedesktop-dbus.c
+++ b/src/nautilus-freedesktop-dbus.c
@@ -41,6 +41,14 @@ struct _NautilusFreedesktopDBus
/* Our DBus implementation skeleton */
NautilusFreedesktopFileManager1 *skeleton;
+
+ GDBusConnection *connection;
+};
+
+enum
+{
+ PROP_0,
+ PROP_CONNECTION,
};
struct _NautilusFreedesktopDBusClass
@@ -149,27 +157,6 @@ skeleton_handle_show_item_properties_cb (NautilusFreedesktopFileManager1 *object
return TRUE;
}
-static void
-bus_acquired_cb (GDBusConnection *conn,
- const gchar *name,
- gpointer user_data)
-{
- NautilusFreedesktopDBus *fdb = user_data;
-
- DEBUG ("Bus acquired at %s", name);
-
- fdb->skeleton = nautilus_freedesktop_file_manager1_skeleton_new ();
-
- g_signal_connect (fdb->skeleton, "handle-show-items",
- G_CALLBACK (skeleton_handle_show_items_cb), fdb);
- g_signal_connect (fdb->skeleton, "handle-show-folders",
- G_CALLBACK (skeleton_handle_show_folders_cb), fdb);
- g_signal_connect (fdb->skeleton, "handle-show-item-properties",
- G_CALLBACK (skeleton_handle_show_item_properties_cb), fdb);
-
- g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (fdb->skeleton), conn, NAUTILUS_FDO_DBUS_PATH, NULL);
-}
-
static void
name_acquired_cb (GDBusConnection *connection,
const gchar *name,
@@ -186,6 +173,20 @@ name_lost_cb (GDBusConnection *connection,
DEBUG ("Lost (or failed to acquire) the name %s on the session message bus\n", name);
}
+static void
+nautilus_freedesktop_dbus_constructed (GObject *object)
+{
+ NautilusFreedesktopDBus *fdb = NAUTILUS_FREEDESKTOP_DBUS (object);
+
+ fdb->owner_id = g_bus_own_name_on_connection (fdb->connection,
+ NAUTILUS_FDO_DBUS_NAME,
+ G_BUS_NAME_OWNER_FLAGS_NONE,
+ name_acquired_cb,
+ name_lost_cb,
+ fdb,
+ NULL);
+}
+
static void
nautilus_freedesktop_dbus_dispose (GObject *object)
{
@@ -199,33 +200,87 @@ nautilus_freedesktop_dbus_dispose (GObject *object)
if (fdb->skeleton != NULL)
{
- g_dbus_interface_skeleton_unexport (G_DBUS_INTERFACE_SKELETON (fdb->skeleton));
g_object_unref (fdb->skeleton);
fdb->skeleton = NULL;
}
+ g_clear_object (&fdb->connection);
+
G_OBJECT_CLASS (nautilus_freedesktop_dbus_parent_class)->dispose (object);
}
+static void
+nautilus_freedesktop_dbus_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ NautilusFreedesktopDBus *fdb = NAUTILUS_FREEDESKTOP_DBUS (object);
+
+ switch (prop_id)
+ {
+ case PROP_CONNECTION:
+ {
+ g_set_object (&fdb->connection, g_value_get_object (value));
+ }
+ break;
+
+ default:
+ {
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
+ break;
+ }
+}
+
+static void
+nautilus_freedesktop_dbus_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ NautilusFreedesktopDBus *fdb = NAUTILUS_FREEDESKTOP_DBUS (object);
+
+ switch (prop_id)
+ {
+ case PROP_CONNECTION:
+ {
+ g_value_set_object (value, fdb->connection);
+ }
+ break;
+
+ default:
+ {
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
+ break;
+ }
+}
+
static void
nautilus_freedesktop_dbus_class_init (NautilusFreedesktopDBusClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->dispose = nautilus_freedesktop_dbus_dispose;
+ object_class->constructed = nautilus_freedesktop_dbus_constructed;
+ object_class->get_property = nautilus_freedesktop_dbus_get_property;
+ object_class->set_property = nautilus_freedesktop_dbus_set_property;
+
+ g_object_class_install_property (object_class,
+ PROP_CONNECTION,
+ g_param_spec_object ("connection",
+ "Connection",
+ "GDBus connection property",
+ G_TYPE_DBUS_CONNECTION,
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_READWRITE));
}
static void
nautilus_freedesktop_dbus_init (NautilusFreedesktopDBus *fdb)
{
- fdb->owner_id = g_bus_own_name (G_BUS_TYPE_SESSION,
- NAUTILUS_FDO_DBUS_NAME,
- G_BUS_NAME_OWNER_FLAGS_NONE,
- bus_acquired_cb,
- name_acquired_cb,
- name_lost_cb,
- fdb,
- NULL);
+ fdb->skeleton = nautilus_freedesktop_file_manager1_skeleton_new ();
}
void
@@ -239,8 +294,41 @@ nautilus_freedesktop_dbus_set_open_locations (NautilusFreedesktopDBus *fdb,
/* Tries to own the org.freedesktop.FileManager1 service name */
NautilusFreedesktopDBus *
-nautilus_freedesktop_dbus_new (void)
+nautilus_freedesktop_dbus_new (GDBusConnection *connection)
{
return g_object_new (nautilus_freedesktop_dbus_get_type (),
+ "connection", connection,
NULL);
}
+
+gboolean
+nautilus_freedesktop_dbus_register (NautilusFreedesktopDBus *fdb,
+ GError **error)
+{
+ gboolean success;
+
+ success = g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (fdb->skeleton),
+ fdb->connection,
+ NAUTILUS_FDO_DBUS_PATH,
+ error);
+
+ if (success)
+ {
+ g_signal_connect (fdb->skeleton, "handle-show-items",
+ G_CALLBACK (skeleton_handle_show_items_cb), fdb);
+ g_signal_connect (fdb->skeleton, "handle-show-folders",
+ G_CALLBACK (skeleton_handle_show_folders_cb), fdb);
+ g_signal_connect (fdb->skeleton, "handle-show-item-properties",
+ G_CALLBACK (skeleton_handle_show_item_properties_cb), fdb);
+ }
+
+ return success;
+}
+
+void
+nautilus_freedesktop_dbus_unregister (NautilusFreedesktopDBus *fdb)
+{
+ g_dbus_interface_skeleton_unexport (G_DBUS_INTERFACE_SKELETON (fdb->skeleton));
+
+ g_signal_handlers_disconnect_by_data (fdb->skeleton, fdb);
+}
diff --git a/src/nautilus-freedesktop-dbus.h b/src/nautilus-freedesktop-dbus.h
index 410c420..ee2ced5 100644
--- a/src/nautilus-freedesktop-dbus.h
+++ b/src/nautilus-freedesktop-dbus.h
@@ -23,6 +23,7 @@
#define __NAUTILUS_FREEDESKTOP_DBUS_H__
#include <glib-object.h>
+#include <gio/gio.h>
#define NAUTILUS_FDO_DBUS_IFACE "org.freedesktop.FileManager1"
#define NAUTILUS_FDO_DBUS_NAME "org.freedesktop.FileManager1"
@@ -44,7 +45,10 @@ typedef struct _NautilusFreedesktopDBus NautilusFreedesktopDBus;
typedef struct _NautilusFreedesktopDBusClass NautilusFreedesktopDBusClass;
GType nautilus_freedesktop_dbus_get_type (void);
-NautilusFreedesktopDBus * nautilus_freedesktop_dbus_new (void);
+NautilusFreedesktopDBus * nautilus_freedesktop_dbus_new (GDBusConnection *connection);
+
+gboolean nautilus_freedesktop_dbus_register (NautilusFreedesktopDBus *fdb, GError **error);
+void nautilus_freedesktop_dbus_unregister (NautilusFreedesktopDBus *fdb);
void nautilus_freedesktop_dbus_set_open_locations (NautilusFreedesktopDBus *fdb, const gchar **locations);
--
2.38.1

View File

@ -0,0 +1,42 @@
From e03d731e3dcb8d0f52ffbc6faa188802b742d1e9 Mon Sep 17 00:00:00 2001
From: Ondrej Holy <oholy@redhat.com>
Date: Thu, 26 Jan 2023 13:20:51 +0100
Subject: [PATCH] file-utilities: Prevent passing NULL to g_object_unref
The `nautilus_find_existing_uri_in_hierarchy` function calls the
`g_object_unref` with a `NULL` pointer when `g_file_query_info` fails.
This leads to a crash e.g. when parent directory of the currently
opened location is removed. Let's port the code to use `g_autoptr` to
avoid that.
---
src/nautilus-file-utilities.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/nautilus-file-utilities.c b/src/nautilus-file-utilities.c
index e8f1ca2fb..1c913dbad 100644
--- a/src/nautilus-file-utilities.c
+++ b/src/nautilus-file-utilities.c
@@ -598,7 +598,6 @@ nautilus_generate_unique_file_in_directory (GFile *directory,
GFile *
nautilus_find_existing_uri_in_hierarchy (GFile *location)
{
- GFileInfo *info;
GFile *tmp;
g_assert (location != NULL);
@@ -606,10 +605,11 @@ nautilus_find_existing_uri_in_hierarchy (GFile *location)
location = g_object_ref (location);
while (location != NULL)
{
+ g_autoptr (GFileInfo) info = NULL;
+
info = g_file_query_info (location,
G_FILE_ATTRIBUTE_STANDARD_NAME,
0, NULL, NULL);
- g_object_unref (info);
if (info != NULL)
{
return location;
--
2.40.0

View File

@ -0,0 +1,77 @@
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index 08107a64e..d808b04ff 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -6078,6 +6078,33 @@ action_cut (GSimpleAction *action,
nautilus_file_list_free (selection);
}
+static void
+action_copy_current_location (GSimpleAction *action,
+ GVariant *state,
+ gpointer user_data)
+{
+ NautilusFilesView *view;
+ GtkClipboard *clipboard;
+ GFile *file;
+ gchar *path;
+ NautilusFilesViewPrivate *priv;
+
+ view = NAUTILUS_FILES_VIEW (user_data);
+ priv = nautilus_files_view_get_instance_private (view);
+
+ if (priv->directory_as_file != NULL)
+ {
+ file = nautilus_file_get_location (priv->directory_as_file);
+
+ clipboard = nautilus_clipboard_get (GTK_WIDGET (view));
+ path = g_file_get_parse_name (file);
+ gtk_clipboard_set_text (clipboard, path, -1);
+
+ g_object_unref (file);
+ g_free (path);
+ }
+}
+
static void
action_create_links_in_place (GSimpleAction *action,
GVariant *state,
@@ -6958,6 +6985,7 @@ const GActionEntry view_entries[] =
{ "new-folder", action_new_folder },
{ "select-all", action_select_all },
{ "paste", action_paste_files },
+ { "copy-current-location", action_copy_current_location },
{ "create-link", action_create_links },
{ "new-document" },
/* Selection menu */
@@ -7590,6 +7618,10 @@ real_update_actions_state (NautilusFilesView *view)
g_simple_action_set_enabled (G_SIMPLE_ACTION (action),
can_move_files && !selection_contains_recent &&
!selection_contains_starred);
+ action = g_action_map_lookup_action (G_ACTION_MAP (view_action_group),
+ "copy-current-location");
+ g_simple_action_set_enabled (G_SIMPLE_ACTION (action),
+ !selection_contains_search);
/* Drive menu */
show_mount = (selection != NULL);
diff --git a/src/resources/ui/nautilus-pathbar-context-menu.ui b/src/resources/ui/nautilus-pathbar-context-menu.ui
index 403cf71f6..4d32c1e8e 100644
--- a/src/resources/ui/nautilus-pathbar-context-menu.ui
+++ b/src/resources/ui/nautilus-pathbar-context-menu.ui
@@ -16,6 +16,12 @@
<attribute name="label" translatable="yes">Add to _Bookmarks</attribute>
<attribute name="action">view.bookmark</attribute>
</item>
+ <section>
+ <item>
+ <attribute name="label" translatable="yes">_Copy Location</attribute>
+ <attribute name="action">view.copy-current-location</attribute>
+ </item>
+ </section>
<section>
<item>
<attribute name="label" translatable="yes">_Paste</attribute>
--
2.36.1

View File

@ -0,0 +1,400 @@
diff -ruN nautilus-3.28.1/po/bg.po nautilus-3.28.1.translations/po/bg.po
--- nautilus-3.28.1/po/bg.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/bg.po 2022-09-22 15:47:26.136428703 +0200
@@ -5471,3 +5471,7 @@
#~ msgid "Enter server address…"
#~ msgstr "Въведете адреса на сървъра…"
+
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+msgid "_Copy Location"
+msgstr "_Копиране на местоположение"
diff -ruN nautilus-3.28.1/po/ca.po nautilus-3.28.1.translations/po/ca.po
--- nautilus-3.28.1/po/ca.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/ca.po 2022-09-22 15:47:26.165428628 +0200
@@ -7061,3 +7061,7 @@
#~ "Amb el Nautilus heu d'haver rebut una còpia de la Llicència Pública "
#~ "General de GNU; si no és així, escriviu a la Free Software Foundation, "
#~ "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
+
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+msgid "_Copy Location"
+msgstr "_Copia la ubicació"
diff -ruN nautilus-3.28.1/po/cs.po nautilus-3.28.1.translations/po/cs.po
--- nautilus-3.28.1/po/cs.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/cs.po 2022-09-22 15:47:26.181428586 +0200
@@ -5665,3 +5665,7 @@
#~ msgid "org.gnome.Nautilus"
#~ msgstr "org.gnome.Nautilus"
+
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+msgid "_Copy Location"
+msgstr "Z_kopírovat umístění"
diff -ruN nautilus-3.28.1/po/da.po nautilus-3.28.1.translations/po/da.po
--- nautilus-3.28.1/po/da.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/da.po 2022-09-22 15:47:26.193428555 +0200
@@ -7097,3 +7097,7 @@
#~ msgid "link"
#~ msgstr "henvisning"
+
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+msgid "_Copy Location"
+msgstr "_Kopiér placering"
diff -ruN nautilus-3.28.1/po/de.po nautilus-3.28.1.translations/po/de.po
--- nautilus-3.28.1/po/de.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/de.po 2022-09-22 15:47:26.201428534 +0200
@@ -5716,3 +5716,7 @@
#~ msgid "org.gnome.Nautilus"
#~ msgstr "org.gnome.Nautilus"
+
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+msgid "_Copy Location"
+msgstr "Ort _kopieren"
diff -ruN nautilus-3.28.1/po/el.po nautilus-3.28.1.translations/po/el.po
--- nautilus-3.28.1/po/el.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/el.po 2022-09-22 15:47:26.214428501 +0200
@@ -5910,3 +5910,8 @@
#~ msgstr ""
#~ "Ορίστε αυτό το όνομα αν θέλετε προσαρμοσμένο όνομα για το εικονίδιο του "
#~ "προσωπικού φακέλου στην επιφάνεια εργασίας."
+
+#
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+msgid "_Copy Location"
+msgstr "_Αντιγραφή τοποθεσίας"
diff -ruN nautilus-3.28.1/po/en_GB.po nautilus-3.28.1.translations/po/en_GB.po
--- nautilus-3.28.1/po/en_GB.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/en_GB.po 2022-09-22 15:47:26.228428464 +0200
@@ -9935,3 +9935,7 @@
#~ msgid "Question"
#~ msgstr "Question"
+
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+msgid "_Copy Location"
+msgstr "_Copy Location"
diff -ruN nautilus-3.28.1/po/es.po nautilus-3.28.1.translations/po/es.po
--- nautilus-3.28.1/po/es.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/es.po 2022-09-22 15:47:26.246428418 +0200
@@ -10830,3 +10830,8 @@
#~ msgstr ""
#~ "Nautilus es un shell gráfico para GNOME que facilita la administración de "
#~ "sus archivos y el resto de su sistema."
+
+# src/nautilus-location-bar.c:401
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+msgid "_Copy Location"
+msgstr "Copiar _ubicación"
diff -ruN nautilus-3.28.1/po/eu.po nautilus-3.28.1.translations/po/eu.po
--- nautilus-3.28.1/po/eu.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/eu.po 2022-09-22 15:47:26.257428389 +0200
@@ -8066,3 +8066,7 @@
#~ msgid "Clear contents of Go menu and Back/Forward lists"
#~ msgstr "Joan menuaren eta Atzera/Aurrera zerrenden edukia garbitzen du"
+
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+msgid "_Copy Location"
+msgstr "_Kopiatu kokalekua"
diff -ruN nautilus-3.28.1/po/fa.po nautilus-3.28.1.translations/po/fa.po
--- nautilus-3.28.1/po/fa.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/fa.po 2022-09-22 15:47:26.268428361 +0200
@@ -10082,3 +10082,7 @@
#~ msgid "C_ancel Remove"
#~ msgstr "ان_صراف از حذف"
+
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+msgid "_Copy Location"
+msgstr "_رونوشت از مکان"
diff -ruN nautilus-3.28.1/po/fi.po nautilus-3.28.1.translations/po/fi.po
--- nautilus-3.28.1/po/fi.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/fi.po 2022-09-22 15:47:26.278428335 +0200
@@ -6969,3 +6969,7 @@
#~ msgid "_Up"
#~ msgstr "_Ylös"
+
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+msgid "_Copy Location"
+msgstr "Kopioi si_jainti"
diff -ruN nautilus-3.28.1/po/fr.po nautilus-3.28.1.translations/po/fr.po
--- nautilus-3.28.1/po/fr.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/fr.po 2022-09-22 15:47:26.286428314 +0200
@@ -5975,3 +5975,7 @@
#~ msgid "Copying “%B” to “%B”"
#~ msgstr "Copie de « %B » vers « %B »"
+
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+msgid "_Copy Location"
+msgstr "Co_pier lemplacement"
diff -ruN nautilus-3.28.1/po/fur.po nautilus-3.28.1.translations/po/fur.po
--- nautilus-3.28.1/po/fur.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/fur.po 2022-09-22 15:47:26.295428291 +0200
@@ -7711,3 +7711,7 @@
#~ msgid "Set the zoom level of the current view"
#~ msgstr "Imposte il nivel di zoom de viodude atuâl"
+
+#: src/resources/ui/nautilus-files-view-context-menus.ui:34
+msgid "_Copy Location"
+msgstr "_Copie posizion"
diff -ruN nautilus-3.28.1/po/gl.po nautilus-3.28.1.translations/po/gl.po
--- nautilus-3.28.1/po/gl.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/gl.po 2022-09-22 15:47:26.315428239 +0200
@@ -7429,3 +7429,7 @@
#~ msgid "<big><b>Error autorunning software</b></big>"
#~ msgstr "<big><b>Produciuse un erro ao autoexecutar o software</b></big>"
+
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+msgid "_Copy Location"
+msgstr "_Copiar localización"
diff -ruN nautilus-3.28.1/po/he.po nautilus-3.28.1.translations/po/he.po
--- nautilus-3.28.1/po/he.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/he.po 2022-09-22 15:47:26.336428185 +0200
@@ -10468,3 +10468,7 @@
#~ msgid "Question"
#~ msgstr "שאלה"
+
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+msgid "_Copy Location"
+msgstr "ה_עתקת מיקום"
diff -ruN nautilus-3.28.1/po/hr.po nautilus-3.28.1.translations/po/hr.po
--- nautilus-3.28.1/po/hr.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/hr.po 2022-09-22 15:47:26.349428151 +0200
@@ -6064,3 +6064,7 @@
#~ msgid "Re_verse Order"
#~ msgstr "Ob_rni poredak"
+
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+msgid "_Copy Location"
+msgstr "_Kopiraj lokaciju"
diff -ruN nautilus-3.28.1/po/hu.po nautilus-3.28.1.translations/po/hu.po
--- nautilus-3.28.1/po/hu.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/hu.po 2022-09-22 15:47:26.358428127 +0200
@@ -5566,3 +5566,8 @@
#~ msgid "org.gnome.Nautilus"
#~ msgstr "org.gnome.Nautilus"
+
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+#| msgid "Location"
+msgid "_Copy Location"
+msgstr "Hely má_solása"
diff -ruN nautilus-3.28.1/po/id.po nautilus-3.28.1.translations/po/id.po
--- nautilus-3.28.1/po/id.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/id.po 2022-09-22 15:47:26.369428099 +0200
@@ -5500,3 +5500,7 @@
#: src/gtk/nautilusgtkplacesview.ui:472
msgid "Enter server address…"
msgstr "Masukkan alamat server…"
+
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+msgid "_Copy Location"
+msgstr "_Salin Lokasi"
diff -ruN nautilus-3.28.1/po/ka.po nautilus-3.28.1.translations/po/ka.po
--- nautilus-3.28.1/po/ka.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/ka.po 2022-09-22 15:47:26.396428029 +0200
@@ -6877,3 +6877,7 @@
#~ msgid "Video CD"
#~ msgstr "ვიდეო CD ფორმატში"
+
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+msgid "_Copy Location"
+msgstr "_მდებარეობის კოპირება"
diff -ruN nautilus-3.28.1/po/kk.po nautilus-3.28.1.translations/po/kk.po
--- nautilus-3.28.1/po/kk.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/kk.po 2022-09-22 15:47:26.405428006 +0200
@@ -7442,3 +7442,7 @@
#~ msgstr ""
#~ "Қоқыс шелегін тазартуды таңдасаңыз, құрамасы жойылады. Оларды жеке-жеке "
#~ "өшіруге болатынын есте сақтаңыз."
+
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+msgid "_Copy Location"
+msgstr "Орналасуын _көшіріп алу"
diff -ruN nautilus-3.28.1/po/ko.po nautilus-3.28.1.translations/po/ko.po
--- nautilus-3.28.1/po/ko.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/ko.po 2022-09-22 15:47:26.421427964 +0200
@@ -5763,3 +5763,7 @@
#~ msgctxt "shortcut window"
#~ msgid "Bookmarks"
#~ msgstr "책갈피"
+
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+msgid "_Copy Location"
+msgstr "위치 복사(_C)"
diff -ruN nautilus-3.28.1/po/lt.po nautilus-3.28.1.translations/po/lt.po
--- nautilus-3.28.1/po/lt.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/lt.po 2022-09-22 15:47:26.444427904 +0200
@@ -7075,3 +7075,7 @@
#~ msgid "_Up"
#~ msgstr "_Aukštyn"
+
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+msgid "_Copy Location"
+msgstr "_Kopijuoti vietą"
diff -ruN nautilus-3.28.1/po/lv.po nautilus-3.28.1.translations/po/lv.po
--- nautilus-3.28.1/po/lv.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/lv.po 2022-09-22 15:47:26.453427881 +0200
@@ -5648,3 +5648,8 @@
#~ msgid "org.gnome.Nautilus"
#~ msgstr "org.gnome.Nautilus"
+
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+#| msgid "Location"
+msgid "_Copy Location"
+msgstr "_Kopēt atrašanās vietu"
diff -ruN nautilus-3.28.1/po/nl.po nautilus-3.28.1.translations/po/nl.po
--- nautilus-3.28.1/po/nl.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/nl.po 2022-09-22 15:47:26.504427749 +0200
@@ -6405,3 +6405,7 @@
#~ msgid "Move Dow_n"
#~ msgstr "Naar b_eneden"
+
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+msgid "_Copy Location"
+msgstr "Locatie _kopiëren"
diff -ruN nautilus-3.28.1/po/oc.po nautilus-3.28.1.translations/po/oc.po
--- nautilus-3.28.1/po/oc.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/oc.po 2022-09-22 15:47:26.520427708 +0200
@@ -6999,3 +6999,7 @@
#~ msgid "Rename “%s”"
#~ msgstr "Renomenar lo fichièr « %s »"
+
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+msgid "_Copy Location"
+msgstr "_Copiar l'emplaçament"
diff -ruN nautilus-3.28.1/po/pl.po nautilus-3.28.1.translations/po/pl.po
--- nautilus-3.28.1/po/pl.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/pl.po 2022-09-22 15:47:26.535427669 +0200
@@ -5683,3 +5683,7 @@
#~ msgid "org.gnome.Nautilus"
#~ msgstr "org.gnome.Nautilus"
+
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+msgid "_Copy Location"
+msgstr "S_kopiuj położenie"
diff -ruN nautilus-3.28.1/po/pt_BR.po nautilus-3.28.1.translations/po/pt_BR.po
--- nautilus-3.28.1/po/pt_BR.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/pt_BR.po 2022-09-22 15:47:26.547427638 +0200
@@ -7152,3 +7152,7 @@
#~ msgid "_Bookmarks..."
#~ msgstr "_Marcadores..."
+
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+msgid "_Copy Location"
+msgstr "_Copiar local"
diff -ruN nautilus-3.28.1/po/pt.po nautilus-3.28.1.translations/po/pt.po
--- nautilus-3.28.1/po/pt.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/pt.po 2022-09-22 15:47:26.554427619 +0200
@@ -5944,3 +5944,7 @@
#~ msgid "Whether the row represents a network location"
#~ msgstr "Se a linha representa uma localização de rede"
+
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+msgid "_Copy Location"
+msgstr "_Copiar localização"
diff -ruN nautilus-3.28.1/po/ru.po nautilus-3.28.1.translations/po/ru.po
--- nautilus-3.28.1/po/ru.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/ru.po 2022-09-22 15:47:26.567427586 +0200
@@ -6177,3 +6177,7 @@
#~ msgctxt "Bookmark"
#~ msgid "_Name"
#~ msgstr "_Имя"
+
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+msgid "_Copy Location"
+msgstr "_Копировать адрес"
diff -ruN nautilus-3.28.1/po/sl.po nautilus-3.28.1.translations/po/sl.po
--- nautilus-3.28.1/po/sl.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/sl.po 2022-09-22 15:47:26.586427537 +0200
@@ -7338,3 +7338,7 @@
#~ msgid "_About Files"
#~ msgstr "_O programu"
+
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+msgid "_Copy Location"
+msgstr "Kopiraj _mesto"
diff -ruN nautilus-3.28.1/po/sr.po nautilus-3.28.1.translations/po/sr.po
--- nautilus-3.28.1/po/sr.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/sr.po 2022-09-22 15:47:26.605427487 +0200
@@ -7143,3 +7143,7 @@
#~ "ако нисте, пишите Задужбини слободног софтвера на следећу адресу: „Free "
#~ "Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA "
#~ "02110-1301 USA“"
+
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+msgid "_Copy Location"
+msgstr "_Копирај путању"
diff -ruN nautilus-3.28.1/po/sv.po nautilus-3.28.1.translations/po/sv.po
--- nautilus-3.28.1/po/sv.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/sv.po 2022-09-22 15:47:26.614427464 +0200
@@ -6343,3 +6343,7 @@
#~ msgid "%a, %b %e %Y %T"
#~ msgstr "%a %-e %b %Y %T"
+
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+msgid "_Copy Location"
+msgstr "_Kopiera plats"
diff -ruN nautilus-3.28.1/po/tr.po nautilus-3.28.1.translations/po/tr.po
--- nautilus-3.28.1/po/tr.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/tr.po 2022-09-22 15:47:26.640427397 +0200
@@ -6188,3 +6188,7 @@
#~ msgid "D_efault zoom level:"
#~ msgstr "Ön_tanımlı yaklaştırma seviyesi:"
+
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+msgid "_Copy Location"
+msgstr "Konumu _Kopyala"
diff -ruN nautilus-3.28.1/po/uk.po nautilus-3.28.1.translations/po/uk.po
--- nautilus-3.28.1/po/uk.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/uk.po 2022-09-22 15:47:26.652427365 +0200
@@ -7967,3 +7967,7 @@
#~ msgid "Set the zoom level of the current view"
#~ msgstr "Встановити рівень масштабування поточного вікна"
+
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+msgid "_Copy Location"
+msgstr "_Копіювати адресу"
diff -ruN nautilus-3.28.1/po/zh_CN.po nautilus-3.28.1.translations/po/zh_CN.po
--- nautilus-3.28.1/po/zh_CN.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/zh_CN.po 2022-09-22 15:47:26.685427280 +0200
@@ -5495,3 +5495,7 @@
#~ msgid "Zoom In"
#~ msgstr "放大"
+
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+msgid "_Copy Location"
+msgstr "复制位置(_C)"
diff -ruN nautilus-3.28.1/po/zh_TW.po nautilus-3.28.1.translations/po/zh_TW.po
--- nautilus-3.28.1/po/zh_TW.po 2018-04-09 22:02:06.000000000 +0200
+++ nautilus-3.28.1.translations/po/zh_TW.po 2022-09-22 15:47:26.698427246 +0200
@@ -7283,3 +7283,7 @@
#~ "您應該已經和程式一起收到一份 GNU 通用公共許可證的副本。如果還沒有,寫信"
#~ "給: the Free Software Foundation, Inc., 51 Franklin Street, Fifth "
#~ "Floor, Boston, MA 02110-1301 USA"
+
+#: src/resources/ui/nautilus-pathbar-context-menu.ui:53
+msgid "_Copy Location"
+msgstr "複製位置(_C)"

View File

@ -0,0 +1,96 @@
From ba878013689114bf199ba2260f9282ae82b352c4 Mon Sep 17 00:00:00 2001
From: Ondrej Holy <oholy@redhat.com>
Date: Wed, 22 Feb 2023 16:22:43 +0100
Subject: [PATCH] freedesktop-dbus: Try to own the name until after exporting
skeleton
Currently, the `g_bus_own_name_on_connection` function is called for the
`org.freedesktop.FileManager1` name before exporting the
`/org/freedesktop/FileManager1` skeleton. This seemingly works fine in most
cases, but occasionally the name is acquired too early and D-Bus clients
can get `No such interface` error. This is regression caused by the commit
2293e813d3cd1cc47b2b8750f7140647aa066fc8. Let's try to own the nam until
after exporting the skeleton to avoid this error.
---
src/nautilus-freedesktop-dbus.c | 31 +++++++++++++++----------------
1 file changed, 15 insertions(+), 16 deletions(-)
diff --git a/src/nautilus-freedesktop-dbus.c b/src/nautilus-freedesktop-dbus.c
index c253cfaba..c20166abb 100644
--- a/src/nautilus-freedesktop-dbus.c
+++ b/src/nautilus-freedesktop-dbus.c
@@ -162,20 +162,6 @@ name_lost_cb (GDBusConnection *connection,
DEBUG ("Lost (or failed to acquire) the name %s on the session message bus\n", name);
}
-static void
-nautilus_freedesktop_dbus_constructed (GObject *object)
-{
- NautilusFreedesktopDBus *fdb = NAUTILUS_FREEDESKTOP_DBUS (object);
-
- fdb->owner_id = g_bus_own_name_on_connection (fdb->connection,
- NAUTILUS_FDO_DBUS_NAME,
- G_BUS_NAME_OWNER_FLAGS_NONE,
- name_acquired_cb,
- name_lost_cb,
- fdb,
- NULL);
-}
-
static void
nautilus_freedesktop_dbus_dispose (GObject *object)
{
@@ -252,7 +238,6 @@ nautilus_freedesktop_dbus_class_init (NautilusFreedesktopDBusClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->dispose = nautilus_freedesktop_dbus_dispose;
- object_class->constructed = nautilus_freedesktop_dbus_constructed;
object_class->get_property = nautilus_freedesktop_dbus_get_property;
object_class->set_property = nautilus_freedesktop_dbus_set_property;
@@ -301,7 +286,6 @@ nautilus_freedesktop_dbus_set_open_locations (NautilusFreedesktopDB
nautilus_freedesktop_file_manager1_set_open_locations (fdb->skeleton, locations);
}
-/* Tries to own the org.freedesktop.FileManager1 service name */
NautilusFreedesktopDBus *
nautilus_freedesktop_dbus_new (GDBusConnection *connection)
{
@@ -310,6 +294,7 @@ nautilus_freedesktop_dbus_new (GDBusConnection *connection)
NULL);
}
+/* Tries to own the org.freedesktop.FileManager1 service name */
gboolean
nautilus_freedesktop_dbus_register (NautilusFreedesktopDBus *fdb,
GError **error)
@@ -331,12 +316,26 @@ nautilus_freedesktop_dbus_register (NautilusFreedesktopDBus *fdb,
G_CALLBACK (skeleton_handle_show_item_properties_cb), fdb);
}
+ fdb->owner_id = g_bus_own_name_on_connection (fdb->connection,
+ NAUTILUS_FDO_DBUS_NAME,
+ G_BUS_NAME_OWNER_FLAGS_NONE,
+ name_acquired_cb,
+ name_lost_cb,
+ fdb,
+ NULL);
+
return success;
}
void
nautilus_freedesktop_dbus_unregister (NautilusFreedesktopDBus *fdb)
{
+ if (fdb->owner_id != 0)
+ {
+ g_bus_unown_name (fdb->owner_id);
+ fdb->owner_id = 0;
+ }
+
g_dbus_interface_skeleton_unexport (G_DBUS_INTERFACE_SKELETON (fdb->skeleton));
g_signal_handlers_disconnect_by_data (fdb->skeleton, fdb);
--
2.39.1

View File

@ -0,0 +1,189 @@
From a7a31137aee8c4af81d7d447ceb83ccdb2ddadc0 Mon Sep 17 00:00:00 2001
From: Xiang Fan <sfanxiang@gmail.com>
Date: Fri, 13 Jul 2018 11:49:09 -0700
Subject: [PATCH] nautilus-canvas-container: Remove the "include visible area"
logic.
canvas_set_scroll_region_include_visible_area() was added in
ec054c80981e26b71c8bb2e6853b035dc2063e7d to fix
https://bugzilla.gnome.org/show_bug.cgi?id=42068 ("Dragging icons
adjusts scroll area in a way that causes immediate scrolling"). This is
no longer the case, because now icons remain in place when being dragged
and are not allowed to be rearranged.
ec054c80981e26b71c8bb2e6853b035dc2063e7d causes issues relating to extra
scrolling space (#340), hence the removal.
Fixes #340.
---
src/nautilus-canvas-container.c | 79 +--------------------------------
src/nautilus-canvas-container.h | 1 -
src/nautilus-canvas-private.h | 3 --
src/nautilus-canvas-view.c | 6 ---
4 files changed, 1 insertion(+), 88 deletions(-)
diff --git a/src/nautilus-canvas-container.c b/src/nautilus-canvas-container.c
index 09acd47fc..bd05a3a2d 100644
--- a/src/nautilus-canvas-container.c
+++ b/src/nautilus-canvas-container.c
@@ -968,45 +968,6 @@ get_all_icon_bounds (NautilusCanvasContainer *container,
x1, y1, x2, y2, usage);
}
-/* Don't preserve visible white space the next time the scroll region
- * is recomputed when the container is not empty. */
-void
-nautilus_canvas_container_reset_scroll_region (NautilusCanvasContainer *container)
-{
- container->details->reset_scroll_region_trigger = TRUE;
-}
-
-/* Set a new scroll region without eliminating any of the currently-visible area. */
-static void
-canvas_set_scroll_region_include_visible_area (EelCanvas *canvas,
- double x1,
- double y1,
- double x2,
- double y2)
-{
- double old_x1, old_y1, old_x2, old_y2;
- double old_scroll_x, old_scroll_y;
- double height, width;
- GtkAllocation allocation;
-
- eel_canvas_get_scroll_region (canvas, &old_x1, &old_y1, &old_x2, &old_y2);
- gtk_widget_get_allocation (GTK_WIDGET (canvas), &allocation);
-
- width = (allocation.width) / canvas->pixels_per_unit;
- height = (allocation.height) / canvas->pixels_per_unit;
-
- old_scroll_x = gtk_adjustment_get_value (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (canvas)));
- old_scroll_y = gtk_adjustment_get_value (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (canvas)));
-
- x1 = MIN (x1, old_x1 + old_scroll_x);
- y1 = MIN (y1, old_y1 + old_scroll_y);
- x2 = MAX (x2, old_x1 + old_scroll_x + width);
- y2 = MAX (y2, old_y1 + old_scroll_y + height);
-
- eel_canvas_set_scroll_region
- (canvas, x1, y1, x2, y2);
-}
-
void
nautilus_canvas_container_update_scroll_region (NautilusCanvasContainer *container)
{
@@ -1014,24 +975,10 @@ nautilus_canvas_container_update_scroll_region (NautilusCanvasContainer *contain
double pixels_per_unit;
GtkAdjustment *hadj, *vadj;
float step_increment;
- gboolean reset_scroll_region;
GtkAllocation allocation;
pixels_per_unit = EEL_CANVAS (container)->pixels_per_unit;
- reset_scroll_region = container->details->reset_scroll_region_trigger
- || nautilus_canvas_container_is_empty (container);
-
- /* The trigger is only cleared when container is non-empty, so
- * callers can reliably reset the scroll region when an item
- * is added even if extraneous relayouts are called when the
- * window is still empty.
- */
- if (!nautilus_canvas_container_is_empty (container))
- {
- container->details->reset_scroll_region_trigger = FALSE;
- }
-
get_all_icon_bounds (container, &x1, &y1, &x2, &y2, BOUNDS_USAGE_FOR_ENTIRE_ITEM);
/* Add border at the "end"of the layout (i.e. after the icons), to
@@ -1053,18 +1000,7 @@ nautilus_canvas_container_update_scroll_region (NautilusCanvasContainer *contain
y2 -= 1;
y2 = MAX (y1, y2);
- if (reset_scroll_region)
- {
- eel_canvas_set_scroll_region
- (EEL_CANVAS (container),
- x1, y1, x2, y2);
- }
- else
- {
- canvas_set_scroll_region_include_visible_area
- (EEL_CANVAS (container),
- x1, y1, x2, y2);
- }
+ eel_canvas_set_scroll_region (EEL_CANVAS (container), x1, y1, x2, y2);
hadj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (container));
vadj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (container));
@@ -5722,23 +5658,10 @@ nautilus_canvas_container_get_icon_drop_target_uri (NautilusCanvasContainer *con
return uri;
}
-/* Call to reset the scroll region only if the container is not empty,
- * to avoid having the flag linger until the next file is added.
- */
-static void
-reset_scroll_region_if_not_empty (NautilusCanvasContainer *container)
-{
- if (!nautilus_canvas_container_is_empty (container))
- {
- nautilus_canvas_container_reset_scroll_region (container);
- }
-}
-
/* Re-sort, switching to automatic layout if it was in manual layout. */
void
nautilus_canvas_container_sort (NautilusCanvasContainer *container)
{
- reset_scroll_region_if_not_empty (container);
container->details->needs_resort = TRUE;
redo_layout (container);
}
diff --git a/src/nautilus-canvas-container.h b/src/nautilus-canvas-container.h
index a370bba26..33929375d 100644
--- a/src/nautilus-canvas-container.h
+++ b/src/nautilus-canvas-container.h
@@ -271,7 +271,6 @@ void nautilus_canvas_container_set_single_click_mode (Nauti
gboolean single_click_mode);
void nautilus_canvas_container_enable_linger_selection (NautilusCanvasContainer *view,
gboolean enable);
-void nautilus_canvas_container_reset_scroll_region (NautilusCanvasContainer *container);
void nautilus_canvas_container_set_font (NautilusCanvasContainer *container,
const char *font);
void nautilus_canvas_container_set_margins (NautilusCanvasContainer *container,
diff --git a/src/nautilus-canvas-private.h b/src/nautilus-canvas-private.h
index dd5e79060..e60e86299 100644
--- a/src/nautilus-canvas-private.h
+++ b/src/nautilus-canvas-private.h
@@ -192,9 +192,6 @@ struct NautilusCanvasContainerDetails {
int size_allocation_count;
guint size_allocation_count_id;
-
- /* Ignore the visible area the next time the scroll region is recomputed */
- gboolean reset_scroll_region_trigger;
/* a11y items used by canvas items */
guint a11y_item_action_idle_handler;
diff --git a/src/nautilus-canvas-view.c b/src/nautilus-canvas-view.c
index f74ea06db..bd3a7ae5d 100644
--- a/src/nautilus-canvas-view.c
+++ b/src/nautilus-canvas-view.c
@@ -355,12 +355,6 @@ nautilus_canvas_view_add_files (NautilusFilesView *view,
canvas_view = NAUTILUS_CANVAS_VIEW (view);
canvas_container = get_canvas_container (canvas_view);
- /* Reset scroll region for the first canvas added when loading a directory. */
- if (nautilus_files_view_get_loading (view) && nautilus_canvas_container_is_empty (canvas_container))
- {
- nautilus_canvas_container_reset_scroll_region (canvas_container);
- }
-
for (l = files; l != NULL; l = l->next)
{
if (nautilus_canvas_container_add (canvas_container,
--
2.37.1

View File

@ -0,0 +1,16 @@
diff --git a/src/nautilus-pathbar.c b/src/nautilus-pathbar.c
index 630b8ed33..2fe88fe1d 100644
--- a/src/nautilus-pathbar.c
+++ b/src/nautilus-pathbar.c
@@ -2033,7 +2033,7 @@ button_data_file_changed (NautilusFile *file,
if (g_file_has_prefix (current_location, location) ||
g_file_equal (current_location, location))
{
- nautilus_path_bar_clear_buttons (self);
+ /* Do nothing here, the view will set new path if needed. */
}
else if (g_file_has_prefix (location, current_location))
{
--
2.40.0

View File

@ -0,0 +1,118 @@
From 4bdd3fad8d51e50e3539c8e04bc91538467bd236 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ant=C3=B3nio=20Fernandes?= <antoniof@gnome.org>
Date: Wed, 8 Jul 2020 14:44:38 +0100
Subject: [PATCH] window: Streamline RestoreTabData memory management
When restoring the back and forward lists, we make a deep copy only to
free the data immediately afterwards.
Instead of reallocating the lists unnecessarily, let's just steal them.
Also, use g_queue_free_full() to make free_restore_tab_data() a proper
GDestroyNotify; also define it in window-slot.c, where it belongs.
---
src/nautilus-window-slot.c | 16 ++++++++++++++--
src/nautilus-window-slot.h | 1 +
src/nautilus-window.c | 20 ++------------------
3 files changed, 17 insertions(+), 20 deletions(-)
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index c3260aeb0..bf040bff2 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -155,6 +155,18 @@ static void trash_state_changed_cb (NautilusTrashMonitor *monitor,
gboolean is_empty,
gpointer user_data);
+void
+free_restore_tab_data (gpointer data)
+{
+ RestoreTabData *tab_data = data;
+
+ g_list_free_full (tab_data->back_list, g_object_unref);
+ g_list_free_full (tab_data->forward_list, g_object_unref);
+ nautilus_file_unref (tab_data->file);
+
+ g_free (tab_data);
+}
+
void
nautilus_window_slot_restore_from_data (NautilusWindowSlot *self,
RestoreTabData *data)
@@ -163,9 +175,9 @@ nautilus_window_slot_restore_from_data (NautilusWindowSlot *self,
priv = nautilus_window_slot_get_instance_private (self);
- priv->back_list = g_list_copy_deep (data->back_list, (GCopyFunc) g_object_ref, NULL);
+ priv->back_list = g_steal_pointer (&data->back_list);
- priv->forward_list = g_list_copy_deep (data->forward_list, (GCopyFunc) g_object_ref, NULL);
+ priv->forward_list = g_steal_pointer (&data->forward_list);
priv->view_mode_before_search = data->view_before_search;
diff --git a/src/nautilus-window-slot.h b/src/nautilus-window-slot.h
index 573357d9b..bda1a920f 100644
--- a/src/nautilus-window-slot.h
+++ b/src/nautilus-window-slot.h
@@ -125,4 +125,5 @@ RestoreTabData* nautilus_window_slot_get_restore_tab_data (NautilusWindowSlot *s
/* Only used by slot-dnd */
NautilusView* nautilus_window_slot_get_current_view (NautilusWindowSlot *slot);
+void free_restore_tab_data (gpointer data);
#endif /* NAUTILUS_WINDOW_SLOT_H */
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 1f8d5208e..175da6fce 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -79,8 +79,6 @@ static GtkWidget *nautilus_window_ensure_location_entry (NautilusWindow *window)
static void close_slot (NautilusWindow *window,
NautilusWindowSlot *slot,
gboolean remove_from_notebook);
-static void free_restore_tab_data (gpointer data,
- gpointer user_data);
/* Sanity check: highest mouse button value I could find was 14. 5 is our
* lower threshold (well-documented to be the one of the button events for the
@@ -1374,7 +1372,7 @@ action_restore_tab (GSimpleAction *action,
nautilus_window_slot_open_location_full (slot, location, flags, NULL);
nautilus_window_slot_restore_from_data (slot, data);
- free_restore_tab_data (data, NULL);
+ free_restore_tab_data (data);
}
static void
@@ -2501,19 +2499,6 @@ nautilus_window_destroy (GtkWidget *object)
GTK_WIDGET_CLASS (nautilus_window_parent_class)->destroy (object);
}
-static void
-free_restore_tab_data (gpointer data,
- gpointer user_data)
-{
- RestoreTabData *tab_data = data;
-
- g_list_free_full (tab_data->back_list, g_object_unref);
- g_list_free_full (tab_data->forward_list, g_object_unref);
- nautilus_file_unref (tab_data->file);
-
- g_free (tab_data);
-}
-
static void
nautilus_window_finalize (GObject *object)
{
@@ -2548,8 +2533,7 @@ nautilus_window_finalize (GObject *object)
G_CALLBACK (nautilus_window_on_undo_changed),
window);
- g_queue_foreach (priv->tab_data_queue, (GFunc) free_restore_tab_data, NULL);
- g_queue_free (priv->tab_data_queue);
+ g_queue_free_full (priv->tab_data_queue, free_restore_tab_data);
g_object_unref (priv->pad_controller);
--
2.35.1

View File

@ -0,0 +1,37 @@
From 87d2f2cfd61baf813aee204be570172b78159281 Mon Sep 17 00:00:00 2001
From: Ondrej Holy <oholy@redhat.com>
Date: Wed, 14 Jun 2023 12:52:02 +0200
Subject: [PATCH] window-slot: Fix conditions to restore selection when
reloading
Currently, the `nautilus_window_slot_force_reload` function doesn't
preserve selection or position. However, there is a code that should do
it. The code is executed only when `new_content_view != NULL`, but it
is based on the `content_view` property. This seems to be a regression
caused by the commit 9806d70e. Let's fix that condition in order to
ensure that the selection and position are restored.
---
src/nautilus-window-slot.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index 2bfb3f3ce..8ceac9562 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -2376,11 +2376,11 @@ nautilus_window_slot_force_reload (NautilusWindowSlot *self)
g_object_ref (location);
current_pos = NULL;
- if (priv->new_content_view)
+ if (priv->content_view)
{
selection = nautilus_view_get_selection (priv->content_view);
- if (NAUTILUS_IS_FILES_VIEW (priv->new_content_view))
+ if (NAUTILUS_IS_FILES_VIEW (priv->content_view))
{
current_pos = nautilus_files_view_get_first_visible_file (NAUTILUS_FILES_VIEW (priv->content_view));
}
--
2.40.0

View File

@ -0,0 +1,43 @@
From f68481d2d8393f1ba1a9b0a86a1b28b6ac303a63 Mon Sep 17 00:00:00 2001
From: Ondrej Holy <oholy@redhat.com>
Date: Wed, 24 May 2023 13:09:35 +0200
Subject: [PATCH] window-slot: Force reload current location when it reappears
When the currently opened location disappears, nautilus tries to
reopen it thanks to the commit b0e28bc1. However, the
`nautilus_window_slot_open_location_full` function doesn't begin the
location change when the old location is the same as the new one. This
is a problem because the old `NautilusFile` object is marked as gone
and thus monitoring and perhaps some other stuff won't work. Let's use
the `nautilus_window_slot_force_reload` function instead, in this case,
to ensure that the underlying `NautilusFile` is updated.
---
src/nautilus-window-slot.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index 811152a21..561b34f12 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -1458,7 +1458,17 @@ viewed_file_changed_callback (NautilusFile *file,
go_to_file = g_file_new_for_path (g_get_home_dir ());
}
- nautilus_window_slot_open_location_full (self, go_to_file, 0, NULL);
+ if (g_file_equal (location, go_to_file))
+ {
+ /* Path gone by time out may have been remounted by
+ * `nautilus_find_existing_uri_in_hierarchy()`.
+ */
+ nautilus_window_slot_force_reload (self);
+ }
+ else
+ {
+ nautilus_window_slot_open_location_full (self, go_to_file, 0, NULL);
+ }
g_object_unref (go_to_file);
g_object_unref (location);
--
2.40.0

View File

@ -0,0 +1,170 @@
From 148559bc6809aac40be4aff64b7d3a4e5ac3c59a Mon Sep 17 00:00:00 2001
From: Sachin Daluja <30343-sachindaluja@users.noreply.gitlab.gnome.org>
Date: Sun, 24 May 2020 13:29:49 -0400
Subject: [PATCH] window-slot: Rename RestoreTabData to NautilusNavigationState
This struct is going to be used to also restore navigation state when
replacing the active window slot in order to handle other-locations://
Also enhance it to also save and restore the current location bookmark.
---
src/nautilus-window-slot.c | 28 ++++++++++++++++------------
src/nautilus-window-slot.h | 11 ++++++-----
src/nautilus-window.c | 12 ++++++------
3 files changed, 28 insertions(+), 23 deletions(-)
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index bf040bff2..e688f0716 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -156,20 +156,21 @@ static void trash_state_changed_cb (NautilusTrashMonitor *monitor,
gpointer user_data);
void
-free_restore_tab_data (gpointer data)
+free_navigation_state (gpointer data)
{
- RestoreTabData *tab_data = data;
+ NautilusNavigationState *navigation_state = data;
- g_list_free_full (tab_data->back_list, g_object_unref);
- g_list_free_full (tab_data->forward_list, g_object_unref);
- nautilus_file_unref (tab_data->file);
+ g_list_free_full (navigation_state->back_list, g_object_unref);
+ g_list_free_full (navigation_state->forward_list, g_object_unref);
+ nautilus_file_unref (navigation_state->file);
+ g_clear_object (&navigation_state->current_location_bookmark);
- g_free (tab_data);
+ g_free (navigation_state);
}
void
-nautilus_window_slot_restore_from_data (NautilusWindowSlot *self,
- RestoreTabData *data)
+nautilus_window_slot_restore_navigation_state (NautilusWindowSlot *self,
+ NautilusNavigationState *data)
{
NautilusWindowSlotPrivate *priv;
@@ -181,14 +182,16 @@ nautilus_window_slot_restore_from_data (NautilusWindowSlot *self,
priv->view_mode_before_search = data->view_before_search;
+ g_set_object (&priv->current_location_bookmark, data->current_location_bookmark);
+
priv->location_change_type = NAUTILUS_LOCATION_CHANGE_RELOAD;
}
-RestoreTabData *
-nautilus_window_slot_get_restore_tab_data (NautilusWindowSlot *self)
+NautilusNavigationState *
+nautilus_window_slot_get_navigation_state (NautilusWindowSlot *self)
{
NautilusWindowSlotPrivate *priv;
- RestoreTabData *data;
+ NautilusNavigationState *data;
GList *back_list;
GList *forward_list;
@@ -211,11 +214,12 @@ nautilus_window_slot_get_restore_tab_data (NautilusWindowSlot *self)
* the view mode before search and a reference to the file.
* A GFile isn't enough, as the NautilusFile also keeps a
* reference to the search directory */
- data = g_new0 (RestoreTabData, 1);
+ data = g_new0 (NautilusNavigationState, 1);
data->back_list = back_list;
data->forward_list = forward_list;
data->file = nautilus_file_get (priv->location);
data->view_before_search = priv->view_mode_before_search;
+ g_set_object (&data->current_location_bookmark, priv->current_location_bookmark);
return data;
}
diff --git a/src/nautilus-window-slot.h b/src/nautilus-window-slot.h
index bda1a920f..2edc96786 100644
--- a/src/nautilus-window-slot.h
+++ b/src/nautilus-window-slot.h
@@ -48,7 +48,8 @@ typedef struct
gint view_before_search;
GList *back_list;
GList *forward_list;
-} RestoreTabData;
+ NautilusBookmark *current_location_bookmark;
+} NautilusNavigationState;
struct _NautilusWindowSlotClass {
GtkBoxClass parent_class;
@@ -117,13 +118,13 @@ void nautilus_window_slot_search (NautilusWindowSlot *
gboolean nautilus_window_slot_handles_location (NautilusWindowSlot *self,
GFile *location);
-void nautilus_window_slot_restore_from_data (NautilusWindowSlot *self,
- RestoreTabData *data);
+void nautilus_window_slot_restore_navigation_state (NautilusWindowSlot *self,
+ NautilusNavigationState *data);
-RestoreTabData* nautilus_window_slot_get_restore_tab_data (NautilusWindowSlot *self);
+NautilusNavigationState* nautilus_window_slot_get_navigation_state (NautilusWindowSlot *self);
/* Only used by slot-dnd */
NautilusView* nautilus_window_slot_get_current_view (NautilusWindowSlot *slot);
-void free_restore_tab_data (gpointer data);
+void free_navigation_state (gpointer data);
#endif /* NAUTILUS_WINDOW_SLOT_H */
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 175da6fce..900239cb8 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -1349,7 +1349,7 @@ action_restore_tab (GSimpleAction *action,
NautilusWindowOpenFlags flags;
g_autoptr (GFile) location = NULL;
NautilusWindowSlot *slot;
- RestoreTabData *data;
+ NautilusNavigationState *data;
priv = nautilus_window_get_instance_private (window);
@@ -1370,9 +1370,9 @@ action_restore_tab (GSimpleAction *action,
slot = nautilus_window_create_and_init_slot (window, location, flags);
nautilus_window_slot_open_location_full (slot, location, flags, NULL);
- nautilus_window_slot_restore_from_data (slot, data);
+ nautilus_window_slot_restore_navigation_state (slot, data);
- free_restore_tab_data (data);
+ free_navigation_state (data);
}
static void
@@ -1579,7 +1579,7 @@ nautilus_window_slot_close (NautilusWindow *window,
{
NautilusWindowPrivate *priv;
NautilusWindowSlot *next_slot;
- RestoreTabData *data;
+ NautilusNavigationState *data;
DEBUG ("Requesting to remove slot %p from window %p", slot, window);
if (window == NULL)
@@ -1595,7 +1595,7 @@ nautilus_window_slot_close (NautilusWindow *window,
nautilus_window_set_active_slot (window, next_slot);
}
- data = nautilus_window_slot_get_restore_tab_data (slot);
+ data = nautilus_window_slot_get_navigation_state (slot);
if (data != NULL)
{
g_queue_push_head (priv->tab_data_queue, data);
@@ -2533,7 +2533,7 @@ nautilus_window_finalize (GObject *object)
G_CALLBACK (nautilus_window_on_undo_changed),
window);
- g_queue_free_full (priv->tab_data_queue, free_restore_tab_data);
+ g_queue_free_full (priv->tab_data_queue, free_navigation_state);
g_object_unref (priv->pad_controller);
--
2.35.1

View File

@ -0,0 +1,72 @@
From b0e28bc19c065b4bc1d6fdea922ae2c09115b0e6 Mon Sep 17 00:00:00 2001
From: Ondrej Holy <oholy@redhat.com>
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

View File

@ -0,0 +1,242 @@
From fe7533b0b82e2ebc7767006ee9768572700a91df Mon Sep 17 00:00:00 2001
From: Sachin Daluja <30343-sachindaluja@users.noreply.gitlab.gnome.org>
Date: Sun, 10 May 2020 22:30:03 -0400
Subject: [PATCH] window, window-slot: Save and restore navigation history
When a new window slot instance replaces the existing one to handle the new
location.
This allows back and forward history lists to be preserved when the window
switches between instances of different window slot classes.
Closes https://gitlab.gnome.org/GNOME/nautilus/-/issues/32
---
src/nautilus-window-slot.c | 48 +++++++++++++++++++---
src/nautilus-window-slot.h | 13 ++++++
src/nautilus-window.c | 84 +++++++++++++++++++++++++++++++++++++-
3 files changed, 138 insertions(+), 7 deletions(-)
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index e688f0716..69040fc44 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -176,6 +176,9 @@ nautilus_window_slot_restore_navigation_state (NautilusWindowSlot *self,
priv = nautilus_window_slot_get_instance_private (self);
+ /* We are restoring saved history to newly created slot with no history. */
+ g_warn_if_fail (priv->back_list == NULL && priv->forward_list == NULL);
+
priv->back_list = g_steal_pointer (&data->back_list);
priv->forward_list = g_steal_pointer (&data->forward_list);
@@ -2003,12 +2006,11 @@ nautilus_window_slot_set_content_view (NautilusWindowSlot *self,
}
void
-nautilus_window_back_or_forward (NautilusWindow *window,
- gboolean back,
- guint distance,
- NautilusWindowOpenFlags flags)
+nautilus_window_slot_back_or_forward (NautilusWindowSlot *self,
+ gboolean back,
+ guint distance,
+ NautilusWindowOpenFlags flags)
{
- NautilusWindowSlot *self;
GList *list;
GFile *location;
guint len;
@@ -2016,7 +2018,6 @@ nautilus_window_back_or_forward (NautilusWindow *window,
GFile *old_location;
NautilusWindowSlotPrivate *priv;
- self = nautilus_window_get_active_slot (window);
priv = nautilus_window_slot_get_instance_private (self);
list = back ? priv->back_list : priv->forward_list;
@@ -3308,3 +3309,38 @@ nautilus_window_slot_get_loading (NautilusWindowSlot *self)
return priv->loading;
}
+
+/*
+ * Open the specified location and set up the navigation history including the
+ * back and forward lists. This function is intended to be called when switching
+ * between NautilusWindowSlot and NautilusOtherLocationsWindowSlot. It allows
+ * the navigation history accumulated in the slot being replaced to be loaded
+ * into the replacing slot.
+ *
+ * The 'location' member variable is set to the new location before calling
+ * begin_location_change() to ensure that it matches the
+ * 'current_location_bookmark' member as expected by the location change
+ * pipeline.
+ */
+void
+nautilus_window_slot_open_location_set_navigation_state (NautilusWindowSlot *self,
+ GFile *location,
+ NautilusWindowOpenFlags flags,
+ GList *new_selection,
+ NautilusLocationChangeType change_type,
+ NautilusNavigationState *navigation_state,
+ guint distance)
+{
+ NautilusWindowSlotPrivate *priv;
+
+ priv = nautilus_window_slot_get_instance_private (self);
+
+ nautilus_window_slot_restore_navigation_state (self, navigation_state);
+
+ g_clear_object (&priv->location);
+
+ priv->location = nautilus_file_get_location (navigation_state->file);
+
+ begin_location_change (self, location, NULL, new_selection,
+ change_type, distance, NULL);
+}
diff --git a/src/nautilus-window-slot.h b/src/nautilus-window-slot.h
index 2edc96786..cbd3454ce 100644
--- a/src/nautilus-window-slot.h
+++ b/src/nautilus-window-slot.h
@@ -82,6 +82,14 @@ void nautilus_window_slot_open_location_full (NautilusWindowSlot
NautilusWindowOpenFlags flags,
GList *new_selection);
+void nautilus_window_slot_open_location_set_navigation_state (NautilusWindowSlot *slot,
+ GFile *location,
+ NautilusWindowOpenFlags flags,
+ GList *new_selection,
+ NautilusLocationChangeType change_type,
+ NautilusNavigationState *navigation_state,
+ guint distance);
+
GFile * nautilus_window_slot_get_location (NautilusWindowSlot *slot);
NautilusBookmark *nautilus_window_slot_get_bookmark (NautilusWindowSlot *slot);
@@ -126,5 +134,10 @@ NautilusNavigationState* nautilus_window_slot_get_navigation_state (NautilusWind
/* Only used by slot-dnd */
NautilusView* nautilus_window_slot_get_current_view (NautilusWindowSlot *slot);
+void nautilus_window_slot_back_or_forward (NautilusWindowSlot *slot,
+ gboolean back,
+ guint distance,
+ NautilusWindowOpenFlags flags);
+
void free_navigation_state (gpointer data);
#endif /* NAUTILUS_WINDOW_SLOT_H */
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 900239cb8..af01b43e7 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -613,6 +613,7 @@ nautilus_window_open_location_full (NautilusWindow *window,
{
NautilusWindowSlot *active_slot;
gboolean new_tab_at_end;
+ NautilusNavigationState *navigation_state = NULL;
/* The location owner can be one of the slots requesting to handle an
* unhandled location. But this slot can be destroyed when switching to
@@ -644,6 +645,8 @@ nautilus_window_open_location_full (NautilusWindow *window,
}
else if (!nautilus_window_slot_handles_location (target_slot, location))
{
+ navigation_state = nautilus_window_slot_get_navigation_state (active_slot);
+
target_slot = replace_active_slot (window, location, flags);
}
@@ -655,7 +658,19 @@ nautilus_window_open_location_full (NautilusWindow *window,
nautilus_window_set_active_slot (window, target_slot);
}
- nautilus_window_slot_open_location_full (target_slot, location, flags, selection);
+ if (navigation_state != NULL)
+ {
+ nautilus_window_slot_open_location_set_navigation_state (target_slot,
+ location, flags, selection,
+ NAUTILUS_LOCATION_CHANGE_STANDARD,
+ navigation_state, 0);
+
+ free_navigation_state (navigation_state);
+ }
+ else
+ {
+ nautilus_window_slot_open_location_full (target_slot, location, flags, selection);
+ }
g_object_unref (location);
}
@@ -3099,3 +3114,70 @@ nautilus_window_search (NautilusWindow *window,
g_warning ("Trying search on a slot but no active slot present");
}
}
+
+/* Ideally, this method should be a simple wrapper for the slot method. However,
+ * going back or forward can result in a new slot (or another subclass), so we
+ * workaround that by duplicating part of nautilus_window_slot_back_or_forward()
+ */
+void
+nautilus_window_back_or_forward (NautilusWindow *window,
+ gboolean back,
+ guint distance,
+ NautilusWindowOpenFlags flags)
+{
+ NautilusWindowSlot *slot;
+ GList *next_location_list, *back_list, *forward_list;
+ GFile *next_location;
+ guint len;
+ NautilusBookmark *next_location_bookmark;
+ gboolean active_slot_handles_location;
+
+ slot = nautilus_window_get_active_slot (window);
+ back_list = nautilus_window_slot_get_back_history (slot);
+ forward_list = nautilus_window_slot_get_forward_history (slot);
+
+ next_location_list = back ? back_list : forward_list;
+
+ len = (guint) g_list_length (next_location_list);
+
+ /* If we can't move in the direction at all, just return. */
+ if (len == 0)
+ {
+ return;
+ }
+
+ /* If the distance to move is off the end of the list, go to the end
+ * of the list. */
+ if (distance >= len)
+ {
+ distance = len - 1;
+ }
+
+ next_location_bookmark = g_list_nth_data (next_location_list, distance);
+ next_location = nautilus_bookmark_get_location (next_location_bookmark);
+
+ active_slot_handles_location = nautilus_window_slot_handles_location (slot, next_location);
+
+ if (!active_slot_handles_location)
+ {
+ NautilusNavigationState *navigation_state;
+ NautilusLocationChangeType location_change_type;
+
+ navigation_state = nautilus_window_slot_get_navigation_state (slot);
+
+ location_change_type = back ? NAUTILUS_LOCATION_CHANGE_BACK : NAUTILUS_LOCATION_CHANGE_FORWARD;
+
+ slot = replace_active_slot (window, next_location, flags);
+
+ nautilus_window_slot_open_location_set_navigation_state (slot,
+ next_location, flags, NULL,
+ location_change_type,
+ navigation_state, distance);
+
+ free_navigation_state (navigation_state);
+ }
+ else
+ {
+ nautilus_window_slot_back_or_forward (slot, back, distance, flags);
+ }
+}
--
2.35.1

View File

@ -8,7 +8,7 @@
Name: nautilus
Version: 3.28.1
Release: 15%{?dist}
Release: 25%{?dist}
Summary: File manager for GNOME
License: GPLv3+
@ -69,6 +69,33 @@ Patch33: search-engine-tracker-Expand-macro-as-string.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1906499
Patch34: nautilus-file.c-Fix-open-writable-file-in-recent-tab.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2068092
Patch35: window-Streamline-RestoreTabData-memory-management.patch
Patch36: window-slot-Rename-RestoreTabData-to-NautilusNavigat.patch
Patch37: window-window-slot-Save-and-restore-navigation-histo.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2068089
Patch38: Add-actions-to-the-toolbar.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2094431
Patch39: files-view-Add-menu-item-to-copy-current-path.patch
Patch40: files-view-Backport-translations.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2106241
Patch41: nautilus-canvas-container-Remove-the-include-visible.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2150894
Patch42: Revert-application-add-common-startup-code.patch
Patch43: application-Export-FileManager1-iface-from-dbus_regi.patch
Patch44: freedesktop-dbus-Try-to-own-the-name-until-after-exp.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2100426
Patch45: window-slot-Try-current-location-even-if-it-is-marke.patch
Patch46: window-slot-Force-reload-current-location-when-it-re.patch
Patch47: pathbar-Do-nothing-when-current-location-disappears.patch
Patch48: file-utilities-Prevent-passing-NULL-to-g_object_unre.patch
Patch49: window-slot-Fix-conditions-to-restore-selection-when.patch
BuildRequires: gtk-doc
BuildRequires: meson
BuildRequires: gcc
@ -181,6 +208,36 @@ desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/*.desktop
%{_datadir}/gir-1.0/*.gir
%changelog
* Wed Jun 14 2023 Ondrej Holy <oholy@redhat.com> - 3.28.1-25
- Force reload current location when it reappears (#2100426)
* Wed Apr 05 2023 Ondrej Holy <oholy@redhat.com> - 3.28.1-24
- Try current location even if it is marked as gone (#2100426)
* Thu Feb 23 2023 Ondrej Holy <oholy@redhat.com> - 3.28.1-23
- Try to own the name until after exporting skeleton (#2150894)
* Wed Feb 01 2023 Ondrej Holy <oholy@redhat.com> - 3.28.1-22
- Export FileManager1 iface from dbus_register vfunc (#2150894)
* Thu Sep 22 2022 Ondrej Holy <oholy@redhat.com> - 3.28.1-21
- Backport "_Copy Location" translations (#2099981)
* Tue Aug 9 2022 Ondrej Holy <oholy@redhat.com> - 3.28.1-20
- Fix scrolling issues in the icon view on focus changes (#2106241)
* Fri Jul 29 2022 Ondrej Holy <oholy@redhat.com> - 3.28.1-19
- Fix the "Copy Location" action to copy just the plain path (#2094431)
* Mon Jun 20 2022 Ondrej Holy <oholy@redhat.com> - 3.28.1-18
- Add toolbar action to copy current location (#2094431)
* Mon Jun 6 2022 Ondrej Holy <oholy@redhat.com> - 3.28.1-17
- Add actions to the toolbar (#2068089)
* Wed Apr 13 2022 Ondrej Holy <oholy@redhat.com> - 3.28.1-16
- Save and restore navigation history when changing window slot (#2068092)
* Wed Jan 6 2021 Ondrej Holy <oholy@redhat.com> - 3.28.1-15
- Fix activation_uri handling to prevent invalid bookmarks (rhbz#1906499)