diff options
author | Florian Müllner <fmuellner@gnome.org> | 2020-01-20 14:03:32 +0100 |
---|---|---|
committer | Javier Jardón Cabezas <javierjc1982@gmail.com> | 2020-01-28 07:52:11 +0000 |
commit | 230b64ce5536737590f088b7712fa18c6631ebfb (patch) | |
tree | 2a8261024230cbd1ac91a03b9b5de0f4f636a28a | |
parent | 795c118cb783a4f97f4b5d95b132187a98b240c9 (diff) | |
download | gnome-desktop-230b64ce5536737590f088b7712fa18c6631ebfb.tar.gz |
idle-monitor: Harcode proxy path
When commit 9d01763ba removed the (kinda obsolete) device property,
it also removed the code that initializes the path struct member,
so we end up with a NULL value in strcmp and a crash.
Given that the path is now fixed, we can just hardcode it.
https://gitlab.gnome.org/GNOME/gnome-desktop/merge_requests/61
-rw-r--r-- | libgnome-desktop/gnome-idle-monitor.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libgnome-desktop/gnome-idle-monitor.c b/libgnome-desktop/gnome-idle-monitor.c index 7292a99d..794d328c 100644 --- a/libgnome-desktop/gnome-idle-monitor.c +++ b/libgnome-desktop/gnome-idle-monitor.c @@ -45,7 +45,6 @@ struct _GnomeIdleMonitorPrivate int name_watch_id; GHashTable *watches; GHashTable *watches_by_upstream_id; - gchar *path; }; typedef struct @@ -73,6 +72,8 @@ G_DEFINE_TYPE_WITH_CODE (GnomeIdleMonitor, gnome_idle_monitor, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, gnome_idle_monitor_initable_iface_init)) +#define IDLE_MONITOR_PATH "/org/gnome/Mutter/IdleMonitor/Core" + static void on_watch_fired (MetaDBusIdleMonitor *proxy, guint upstream_id, @@ -160,7 +161,6 @@ gnome_idle_monitor_dispose (GObject *object) g_clear_object (&monitor->priv->om); g_clear_pointer (&monitor->priv->watches, g_hash_table_destroy); g_clear_pointer (&monitor->priv->watches_by_upstream_id, g_hash_table_destroy); - g_clear_pointer (&monitor->priv->path, g_free); G_OBJECT_CLASS (gnome_idle_monitor_parent_class)->dispose (object); } @@ -204,7 +204,7 @@ on_object_added (GDBusObjectManager *manager, { GnomeIdleMonitor *monitor = user_data; - if (!g_str_equal (monitor->priv->path, g_dbus_object_get_object_path (object))) + if (!g_str_equal (IDLE_MONITOR_PATH, g_dbus_object_get_object_path (object))) return; connect_proxy (object, monitor); @@ -218,7 +218,7 @@ get_proxy (GnomeIdleMonitor *monitor) GDBusObject *object; object = g_dbus_object_manager_get_object (G_DBUS_OBJECT_MANAGER (monitor->priv->om), - monitor->priv->path); + IDLE_MONITOR_PATH); if (object) { connect_proxy (object, monitor); g_object_unref (object); |