[gnome-desktop] idle-monitor: Harcode proxy path
- From: Javier Jardón Cabezas <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-desktop] idle-monitor: Harcode proxy path
- Date: Tue, 28 Jan 2020 07:55:41 +0000 (UTC)
commit 230b64ce5536737590f088b7712fa18c6631ebfb
Author: Florian Müllner <fmuellner gnome org>
Date: Mon Jan 20 14:03:32 2020 +0100
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
libgnome-desktop/gnome-idle-monitor.c | 8 ++++----
1 file 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]