|
|
7bbc84 |
From 7de08188d8d012d9aa8f49fe27b7992d081a7307 Mon Sep 17 00:00:00 2001
|
|
|
7bbc84 |
From: Ondrej Holy <oholy@redhat.com>
|
|
|
7bbc84 |
Date: Wed, 11 Jan 2023 09:44:25 +0100
|
|
|
7bbc84 |
Subject: [PATCH] Revert "freedesktop-dbus: Defer D-Bus property setting"
|
|
|
7bbc84 |
|
|
|
7bbc84 |
This reverts commit 3014f69485a120bedf0eec5af441346a95fe27f7 and part of
|
|
|
7bbc84 |
the commit a1751d3d870c6cdc092f893755623c4ff20e1ef3. This extra handling
|
|
|
7bbc84 |
was needed because `NautilusFreedesktopDBus` methods might be called before
|
|
|
7bbc84 |
establishing its own D-Bus connection. The follow-up commit is going to use
|
|
|
7bbc84 |
the already established connection from the `dbus_register` vfunc. It
|
|
|
7bbc84 |
should be ensured that the `dbus_register` vfunc is called before the
|
|
|
7bbc84 |
`window_added`, `window_removed`, or `startup` vfunc. Consequently, this
|
|
|
7bbc84 |
extra handling is going to be redundant. Let's remove it as a preparation
|
|
|
7bbc84 |
for the next commit.
|
|
|
7bbc84 |
---
|
|
|
7bbc84 |
src/nautilus-freedesktop-dbus.c | 79 ++-------------------------------
|
|
|
7bbc84 |
1 file changed, 3 insertions(+), 76 deletions(-)
|
|
|
7bbc84 |
|
|
|
7bbc84 |
diff --git a/src/nautilus-freedesktop-dbus.c b/src/nautilus-freedesktop-dbus.c
|
|
|
7bbc84 |
index 5cbbbad01..c75678399 100644
|
|
|
7bbc84 |
--- a/src/nautilus-freedesktop-dbus.c
|
|
|
7bbc84 |
+++ b/src/nautilus-freedesktop-dbus.c
|
|
|
7bbc84 |
@@ -40,11 +40,6 @@ struct _NautilusFreedesktopDBus
|
|
|
7bbc84 |
|
|
|
7bbc84 |
/* Our DBus implementation skeleton */
|
|
|
7bbc84 |
NautilusFreedesktopFileManager1 *skeleton;
|
|
|
7bbc84 |
-
|
|
|
7bbc84 |
- GStrv pending_open_locations;
|
|
|
7bbc84 |
- GVariant *pending_open_windows_with_locations;
|
|
|
7bbc84 |
-
|
|
|
7bbc84 |
- gboolean name_lost;
|
|
|
7bbc84 |
};
|
|
|
7bbc84 |
|
|
|
7bbc84 |
G_DEFINE_TYPE (NautilusFreedesktopDBus, nautilus_freedesktop_dbus, G_TYPE_OBJECT);
|
|
|
7bbc84 |
@@ -162,24 +157,6 @@ bus_acquired_cb (GDBusConnection *conn,
|
|
|
7bbc84 |
G_CALLBACK (skeleton_handle_show_item_properties_cb), fdb);
|
|
|
7bbc84 |
|
|
|
7bbc84 |
g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (fdb->skeleton), conn, NAUTILUS_FDO_DBUS_PATH, NULL);
|
|
|
7bbc84 |
-
|
|
|
7bbc84 |
- if (G_UNLIKELY (fdb->pending_open_locations != NULL))
|
|
|
7bbc84 |
- {
|
|
|
7bbc84 |
- g_auto (GStrv) locations = NULL;
|
|
|
7bbc84 |
-
|
|
|
7bbc84 |
- locations = g_steal_pointer (&fdb->pending_open_locations);
|
|
|
7bbc84 |
-
|
|
|
7bbc84 |
- nautilus_freedesktop_dbus_set_open_locations (fdb, (const gchar **) locations);
|
|
|
7bbc84 |
- }
|
|
|
7bbc84 |
-
|
|
|
7bbc84 |
- if (G_UNLIKELY (fdb->pending_open_windows_with_locations != NULL))
|
|
|
7bbc84 |
- {
|
|
|
7bbc84 |
- g_autoptr (GVariant) locations = NULL;
|
|
|
7bbc84 |
-
|
|
|
7bbc84 |
- locations = g_steal_pointer (&fdb->pending_open_windows_with_locations);
|
|
|
7bbc84 |
-
|
|
|
7bbc84 |
- nautilus_freedesktop_dbus_set_open_windows_with_locations (fdb, locations);
|
|
|
7bbc84 |
- }
|
|
|
7bbc84 |
}
|
|
|
7bbc84 |
|
|
|
7bbc84 |
static void
|
|
|
7bbc84 |
@@ -195,13 +172,7 @@ name_lost_cb (GDBusConnection *connection,
|
|
|
7bbc84 |
const gchar *name,
|
|
|
7bbc84 |
gpointer user_data)
|
|
|
7bbc84 |
{
|
|
|
7bbc84 |
- NautilusFreedesktopDBus *fdb;
|
|
|
7bbc84 |
-
|
|
|
7bbc84 |
DEBUG ("Lost (or failed to acquire) the name %s on the session message bus\n", name);
|
|
|
7bbc84 |
-
|
|
|
7bbc84 |
- fdb = NAUTILUS_FREEDESKTOP_DBUS (user_data);
|
|
|
7bbc84 |
-
|
|
|
7bbc84 |
- fdb->name_lost = TRUE;
|
|
|
7bbc84 |
}
|
|
|
7bbc84 |
|
|
|
7bbc84 |
static void
|
|
|
7bbc84 |
@@ -225,24 +196,12 @@ nautilus_freedesktop_dbus_dispose (GObject *object)
|
|
|
7bbc84 |
G_OBJECT_CLASS (nautilus_freedesktop_dbus_parent_class)->dispose (object);
|
|
|
7bbc84 |
}
|
|
|
7bbc84 |
|
|
|
7bbc84 |
-static void
|
|
|
7bbc84 |
-nautilus_freedesktop_dbus_finalize (GObject *object)
|
|
|
7bbc84 |
-{
|
|
|
7bbc84 |
- NautilusFreedesktopDBus *fdb;
|
|
|
7bbc84 |
-
|
|
|
7bbc84 |
- fdb = NAUTILUS_FREEDESKTOP_DBUS (object);
|
|
|
7bbc84 |
-
|
|
|
7bbc84 |
- g_clear_pointer (&fdb->pending_open_locations, g_strfreev);
|
|
|
7bbc84 |
- g_clear_pointer (&fdb->pending_open_windows_with_locations, g_variant_unref);
|
|
|
7bbc84 |
-}
|
|
|
7bbc84 |
-
|
|
|
7bbc84 |
static void
|
|
|
7bbc84 |
nautilus_freedesktop_dbus_class_init (NautilusFreedesktopDBusClass *klass)
|
|
|
7bbc84 |
{
|
|
|
7bbc84 |
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
|
|
7bbc84 |
|
|
|
7bbc84 |
object_class->dispose = nautilus_freedesktop_dbus_dispose;
|
|
|
7bbc84 |
- object_class->finalize = nautilus_freedesktop_dbus_finalize;
|
|
|
7bbc84 |
}
|
|
|
7bbc84 |
|
|
|
7bbc84 |
static void
|
|
|
7bbc84 |
@@ -256,10 +215,6 @@ nautilus_freedesktop_dbus_init (NautilusFreedesktopDBus *fdb)
|
|
|
7bbc84 |
name_lost_cb,
|
|
|
7bbc84 |
fdb,
|
|
|
7bbc84 |
NULL);
|
|
|
7bbc84 |
- fdb->skeleton = NULL;
|
|
|
7bbc84 |
- fdb->pending_open_locations = NULL;
|
|
|
7bbc84 |
- fdb->pending_open_windows_with_locations = NULL;
|
|
|
7bbc84 |
- fdb->name_lost = FALSE;
|
|
|
7bbc84 |
}
|
|
|
7bbc84 |
|
|
|
7bbc84 |
void
|
|
|
7bbc84 |
@@ -268,21 +223,7 @@ nautilus_freedesktop_dbus_set_open_locations (NautilusFreedesktopDBus *fdb,
|
|
|
7bbc84 |
{
|
|
|
7bbc84 |
g_return_if_fail (NAUTILUS_IS_FREEDESKTOP_DBUS (fdb));
|
|
|
7bbc84 |
|
|
|
7bbc84 |
- if (G_UNLIKELY (fdb->skeleton == NULL))
|
|
|
7bbc84 |
- {
|
|
|
7bbc84 |
- if (G_LIKELY (fdb->name_lost))
|
|
|
7bbc84 |
- {
|
|
|
7bbc84 |
- return;
|
|
|
7bbc84 |
- }
|
|
|
7bbc84 |
-
|
|
|
7bbc84 |
- g_clear_pointer (&fdb->pending_open_locations, g_strfreev);
|
|
|
7bbc84 |
-
|
|
|
7bbc84 |
- fdb->pending_open_locations = g_strdupv ((gchar **) locations);
|
|
|
7bbc84 |
- }
|
|
|
7bbc84 |
- else
|
|
|
7bbc84 |
- {
|
|
|
7bbc84 |
- nautilus_freedesktop_file_manager1_set_open_locations (fdb->skeleton, locations);
|
|
|
7bbc84 |
- }
|
|
|
7bbc84 |
+ nautilus_freedesktop_file_manager1_set_open_locations (fdb->skeleton, locations);
|
|
|
7bbc84 |
}
|
|
|
7bbc84 |
|
|
|
7bbc84 |
/**
|
|
|
7bbc84 |
@@ -301,22 +242,8 @@ nautilus_freedesktop_dbus_set_open_windows_with_locations (NautilusFreedesktopDB
|
|
|
7bbc84 |
{
|
|
|
7bbc84 |
g_return_if_fail (NAUTILUS_IS_FREEDESKTOP_DBUS (fdb));
|
|
|
7bbc84 |
|
|
|
7bbc84 |
- if (G_UNLIKELY (fdb->skeleton == NULL))
|
|
|
7bbc84 |
- {
|
|
|
7bbc84 |
- if (G_LIKELY (fdb->name_lost))
|
|
|
7bbc84 |
- {
|
|
|
7bbc84 |
- return;
|
|
|
7bbc84 |
- }
|
|
|
7bbc84 |
-
|
|
|
7bbc84 |
- g_clear_pointer (&fdb->pending_open_windows_with_locations, g_variant_unref);
|
|
|
7bbc84 |
-
|
|
|
7bbc84 |
- fdb->pending_open_windows_with_locations = g_variant_ref (locations);
|
|
|
7bbc84 |
- }
|
|
|
7bbc84 |
- else
|
|
|
7bbc84 |
- {
|
|
|
7bbc84 |
- nautilus_freedesktop_file_manager1_set_open_windows_with_locations (fdb->skeleton,
|
|
|
7bbc84 |
- locations);
|
|
|
7bbc84 |
- }
|
|
|
7bbc84 |
+ nautilus_freedesktop_file_manager1_set_open_windows_with_locations (fdb->skeleton,
|
|
|
7bbc84 |
+ locations);
|
|
|
7bbc84 |
}
|
|
|
7bbc84 |
|
|
|
7bbc84 |
/* Tries to own the org.freedesktop.FileManager1 service name */
|
|
|
7bbc84 |
--
|
|
|
7bbc84 |
2.38.1
|
|
|
7bbc84 |
|