diff options
author | Ted Gould <ted@gould.cx> | 2011-01-19 09:14:11 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-01-19 09:14:11 -0600 |
commit | 2ccba1f88d893323c7374399c3f84267d8773ebb (patch) | |
tree | 0cbe0e9022aa82e428931b2738a539ee2c6a941c | |
parent | 41037f771b0b4b30ab225a4515565c6ea1af0694 (diff) | |
parent | 0718494fed4995aa4c85575fe3d0dd602a63020b (diff) | |
download | libdbusmenu-2ccba1f88d893323c7374399c3f84267d8773ebb.tar.gz libdbusmenu-2ccba1f88d893323c7374399c3f84267d8773ebb.tar.bz2 libdbusmenu-2ccba1f88d893323c7374399c3f84267d8773ebb.zip |
Signal an update layout when the object comes on the bus.
-rw-r--r-- | libdbusmenu-glib/client.c | 15 | ||||
-rw-r--r-- | libdbusmenu-glib/server.c | 13 |
2 files changed, 21 insertions, 7 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index 58d6360..29ed4a0 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -1538,6 +1538,14 @@ parse_layout (DbusmenuClient * client, const gchar * layout) static void update_layout_cb (GObject * proxy, GAsyncResult * res, gpointer data) { + DbusmenuClient * client = DBUSMENU_CLIENT(data); + DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(client); + + if (priv->layoutcall != NULL) { + g_object_unref(priv->layoutcall); + priv->layoutcall = NULL; + } + GError * error = NULL; GVariant * params = NULL; @@ -1554,9 +1562,6 @@ update_layout_cb (GObject * proxy, GAsyncResult * res, gpointer data) g_variant_get(params, "(us)", &rev, &xml); g_variant_unref(params); - DbusmenuClient * client = DBUSMENU_CLIENT(data); - DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(client); - guint parseable = parse_layout(client, xml); g_free(xml); @@ -1567,10 +1572,6 @@ update_layout_cb (GObject * proxy, GAsyncResult * res, gpointer data) priv->my_revision = rev; /* g_debug("Root is now: 0x%X", (unsigned int)priv->root); */ - if (priv->layoutcall != NULL) { - g_object_unref(priv->layoutcall); - priv->layoutcall = NULL; - } #ifdef MASSIVEDEBUGGING g_debug("Client signaling layout has changed."); #endif diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 100eb14..51a47b2 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -506,6 +506,19 @@ register_object (DbusmenuServer * server) if (error != NULL) { g_warning("Unable to register object on bus: %s", error->message); g_error_free(error); + return; + } + + /* If we've got it registered let's tell everyone about it */ + g_signal_emit(G_OBJECT(server), signals[LAYOUT_UPDATED], 0, priv->layout_revision, 0, TRUE); + if (priv->dbusobject != NULL && priv->bus != NULL) { + g_dbus_connection_emit_signal(priv->bus, + NULL, + priv->dbusobject, + DBUSMENU_INTERFACE, + "LayoutUpdated", + g_variant_new("(ui)", priv->layout_revision, 0), + NULL); } return; |