aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-glib/client.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-11-23 13:21:52 -0600
committerTed Gould <ted@gould.cx>2010-11-23 13:21:52 -0600
commit92d355c18217c43c358ccda9d6eb74af9eed30d9 (patch)
tree9fa79347554de1044922d173a6766ffae7d69db5 /libdbusmenu-glib/client.c
parentf5cc5d5809ac1bc60ed2f90424e95988f84194db (diff)
downloadlibdbusmenu-92d355c18217c43c358ccda9d6eb74af9eed30d9.tar.gz
libdbusmenu-92d355c18217c43c358ccda9d6eb74af9eed30d9.tar.bz2
libdbusmenu-92d355c18217c43c358ccda9d6eb74af9eed30d9.zip
Protect update_layout from not having an owner yet, and if we get one immediately call update_layout()
Diffstat (limited to 'libdbusmenu-glib/client.c')
-rw-r--r--libdbusmenu-glib/client.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c
index f283a78..be35dde 100644
--- a/libdbusmenu-glib/client.c
+++ b/libdbusmenu-glib/client.c
@@ -978,7 +978,11 @@ menuproxy_build_cb (GObject * object, GAsyncResult * res, gpointer user_data)
g_signal_connect(priv->menuproxy, "g-signal", G_CALLBACK(menuproxy_signal_cb), client);
g_signal_connect(priv->menuproxy, "notify::g-name-owner", G_CALLBACK(menuproxy_name_changed_cb), client);
- update_layout(client);
+ gchar * name_owner = g_dbus_proxy_get_name_owner(priv->menuproxy);
+ if (name_owner != NULL) {
+ update_layout(client);
+ g_free(name_owner);
+ }
return;
}
@@ -996,6 +1000,7 @@ menuproxy_name_changed_cb (GObject * object, GParamSpec * pspec, gpointer user_d
proxy_destroyed(G_OBJECT(proxy), user_data);
} else {
g_free(owner);
+ update_layout(DBUSMENU_CLIENT(user_data));
}
return;
@@ -1597,6 +1602,12 @@ update_layout (DbusmenuClient * client)
return;
}
+ gchar * name_owner = g_dbus_proxy_get_name_owner(priv->menuproxy);
+ if (name_owner == NULL) {
+ return;
+ }
+ g_free(name_owner);
+
if (priv->layoutcall != NULL) {
return;
}