aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-glib
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2012-01-30 23:20:48 -0600
committerTed Gould <ted@gould.cx>2012-01-30 23:20:48 -0600
commit9332359a3cad3a5f23e7ff0c4bae14159818d026 (patch)
tree372281b1a4a4c9abe902f2726277df5ddda18027 /libdbusmenu-glib
parentf966667e6e1af74f06c65d8cfca78d0b861d5621 (diff)
parent8d7a4ec5cbf30119b0ec553174853556a480228a (diff)
downloadlibdbusmenu-9332359a3cad3a5f23e7ff0c4bae14159818d026.tar.gz
libdbusmenu-9332359a3cad3a5f23e7ff0c4bae14159818d026.tar.bz2
libdbusmenu-9332359a3cad3a5f23e7ff0c4bae14159818d026.zip
Import upstream version 0.5.90
Diffstat (limited to 'libdbusmenu-glib')
-rw-r--r--libdbusmenu-glib/Makefile.am29
-rw-r--r--libdbusmenu-glib/Makefile.in31
-rw-r--r--libdbusmenu-glib/client-marshal.c2
-rw-r--r--libdbusmenu-glib/client.c3
-rw-r--r--libdbusmenu-glib/dbusmenu-glib-0.4.pc.in2
-rw-r--r--libdbusmenu-glib/defaults.c2
-rw-r--r--libdbusmenu-glib/menuitem-marshal.c2
-rw-r--r--libdbusmenu-glib/menuitem.c51
-rw-r--r--libdbusmenu-glib/menuitem.h14
-rw-r--r--libdbusmenu-glib/server-marshal.c2
-rw-r--r--libdbusmenu-glib/server.c35
11 files changed, 153 insertions, 20 deletions
diff --git a/libdbusmenu-glib/Makefile.am b/libdbusmenu-glib/Makefile.am
index 7d4ea5d..6fc3fb8 100644
--- a/libdbusmenu-glib/Makefile.am
+++ b/libdbusmenu-glib/Makefile.am
@@ -15,11 +15,10 @@ include $(top_srcdir)/Makefile.am.enum
lib_LTLIBRARIES = \
libdbusmenu-glib.la
-libdbusmenu_glibincludedir=$(includedir)/libdbusmenu-0.4/libdbusmenu-glib/
+libdbusmenu_glibincludedir=$(includedir)/libdbusmenu-glib-0.4/libdbusmenu-glib/
EXPORTED_OBJECTS = \
- enum-types.h \
menuitem.h \
menuitem-proxy.h \
server.h \
@@ -27,6 +26,7 @@ EXPORTED_OBJECTS = \
libdbusmenu_glibinclude_HEADERS = \
$(EXPORTED_OBJECTS) \
+ enum-types.h \
dbusmenu-glib.h \
types.h
@@ -62,7 +62,9 @@ libdbusmenu_glib_la_LDFLAGS = \
-export-symbols-regex "^[^_].*"
libdbusmenu_glib_la_CFLAGS = \
- $(DBUSMENUGLIB_CFLAGS) -Wall -Werror -DG_DISABLE_DEPRECATED -DG_LOG_DOMAIN="\"LIBDBUSMENU-GLIB\""
+ $(DBUSMENUGLIB_CFLAGS) \
+ -Wall -Werror -Wno-error=deprecated-declarations \
+ -DG_LOG_DOMAIN="\"LIBDBUSMENU-GLIB\""
libdbusmenu_glib_la_LIBADD = \
$(DBUSMENUGLIB_LIBS)
@@ -70,9 +72,16 @@ libdbusmenu_glib_la_LIBADD = \
pkgconfig_DATA = dbusmenu-glib-0.4.pc
pkgconfigdir = $(libdir)/pkgconfig
+ENUMHEADERS = \
+ menuitem.h \
+ menuitem-proxy.h \
+ server.h \
+ client.h \
+ types.h
+
glib_enum_h = enum-types.h
glib_enum_c = enum-types.c
-glib_enum_headers = $(addprefix $(srcdir)/, $(libdbusmenu_glibinclude_HEADERS))
+glib_enum_headers = $(addprefix $(srcdir)/, $(ENUMHEADERS))
DISTCLEANFILES += \
enum-types.c \
@@ -158,16 +167,22 @@ INTROSPECTION_COMPILER_ARGS = --includedir=$(builddir)
if HAVE_INTROSPECTION
+introspection_objects = \
+ $(addprefix $(srcdir)/, $(EXPORTED_OBJECTS)) \
+ $(builddir)/enum-types.h
+
introspection_sources = \
- $(libdbusmenu_glibinclude_HEADERS) \
- $(EXPORTED_OBJECTS:.h=.c)
+ $(addprefix $(srcdir)/, $(EXPORTED_OBJECTS)) \
+ $(srcdir)/dbusmenu-glib.h \
+ $(srcdir)/types.h \
+ $(introspection_objects:.h=.c)
Dbusmenu-0.4.gir: libdbusmenu-glib.la
Dbusmenu_0_4_gir_INCLUDES = \
GObject-2.0
Dbusmenu_0_4_gir_CFLAGS = $(DBUSMENUGLIB_CFLAGS) -I$(top_srcdir)
Dbusmenu_0_4_gir_LIBS = libdbusmenu-glib.la
-Dbusmenu_0_4_gir_FILES = $(addprefix $(srcdir)/, $(introspection_sources))
+Dbusmenu_0_4_gir_FILES = $(introspection_sources)
Dbusmenu_0_4_gir_NAMESPACE = Dbusmenu
Dbusmenu_0_4_gir_VERSION = 0.4
Dbusmenu_0_4_gir_EXPORT_PACKAGES = dbusmenu-glib-0.4
diff --git a/libdbusmenu-glib/Makefile.in b/libdbusmenu-glib/Makefile.in
index b21984c..904231d 100644
--- a/libdbusmenu-glib/Makefile.in
+++ b/libdbusmenu-glib/Makefile.in
@@ -343,9 +343,8 @@ enum_tmpl_c = $(glib_enum_c:.c=.c.in)
lib_LTLIBRARIES = \
libdbusmenu-glib.la
-libdbusmenu_glibincludedir = $(includedir)/libdbusmenu-0.4/libdbusmenu-glib/
+libdbusmenu_glibincludedir = $(includedir)/libdbusmenu-glib-0.4/libdbusmenu-glib/
EXPORTED_OBJECTS = \
- enum-types.h \
menuitem.h \
menuitem-proxy.h \
server.h \
@@ -353,6 +352,7 @@ EXPORTED_OBJECTS = \
libdbusmenu_glibinclude_HEADERS = \
$(EXPORTED_OBJECTS) \
+ enum-types.h \
dbusmenu-glib.h \
types.h
@@ -388,16 +388,25 @@ libdbusmenu_glib_la_LDFLAGS = \
-export-symbols-regex "^[^_].*"
libdbusmenu_glib_la_CFLAGS = \
- $(DBUSMENUGLIB_CFLAGS) -Wall -Werror -DG_DISABLE_DEPRECATED -DG_LOG_DOMAIN="\"LIBDBUSMENU-GLIB\""
+ $(DBUSMENUGLIB_CFLAGS) \
+ -Wall -Werror -Wno-error=deprecated-declarations \
+ -DG_LOG_DOMAIN="\"LIBDBUSMENU-GLIB\""
libdbusmenu_glib_la_LIBADD = \
$(DBUSMENUGLIB_LIBS)
pkgconfig_DATA = dbusmenu-glib-0.4.pc
pkgconfigdir = $(libdir)/pkgconfig
+ENUMHEADERS = \
+ menuitem.h \
+ menuitem-proxy.h \
+ server.h \
+ client.h \
+ types.h
+
glib_enum_h = enum-types.h
glib_enum_c = enum-types.c
-glib_enum_headers = $(addprefix $(srcdir)/, $(libdbusmenu_glibinclude_HEADERS))
+glib_enum_headers = $(addprefix $(srcdir)/, $(ENUMHEADERS))
INTROSPECTION_GIRS = $(am__append_1)
@INTROSPECTION_TEN_FALSE@INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) \
@INTROSPECTION_TEN_FALSE@ --warn-all \
@@ -412,16 +421,22 @@ INTROSPECTION_GIRS = $(am__append_1)
@INTROSPECTION_TEN_TRUE@ --identifier-prefix=Dbusmenu
INTROSPECTION_COMPILER_ARGS = --includedir=$(builddir)
+@HAVE_INTROSPECTION_TRUE@introspection_objects = \
+@HAVE_INTROSPECTION_TRUE@ $(addprefix $(srcdir)/, $(EXPORTED_OBJECTS)) \
+@HAVE_INTROSPECTION_TRUE@ $(builddir)/enum-types.h
+
@HAVE_INTROSPECTION_TRUE@introspection_sources = \
-@HAVE_INTROSPECTION_TRUE@ $(libdbusmenu_glibinclude_HEADERS) \
-@HAVE_INTROSPECTION_TRUE@ $(EXPORTED_OBJECTS:.h=.c)
+@HAVE_INTROSPECTION_TRUE@ $(addprefix $(srcdir)/, $(EXPORTED_OBJECTS)) \
+@HAVE_INTROSPECTION_TRUE@ $(srcdir)/dbusmenu-glib.h \
+@HAVE_INTROSPECTION_TRUE@ $(srcdir)/types.h \
+@HAVE_INTROSPECTION_TRUE@ $(introspection_objects:.h=.c)
@HAVE_INTROSPECTION_TRUE@Dbusmenu_0_4_gir_INCLUDES = \
@HAVE_INTROSPECTION_TRUE@ GObject-2.0
@HAVE_INTROSPECTION_TRUE@Dbusmenu_0_4_gir_CFLAGS = $(DBUSMENUGLIB_CFLAGS) -I$(top_srcdir)
@HAVE_INTROSPECTION_TRUE@Dbusmenu_0_4_gir_LIBS = libdbusmenu-glib.la
-@HAVE_INTROSPECTION_TRUE@Dbusmenu_0_4_gir_FILES = $(addprefix $(srcdir)/, $(introspection_sources))
+@HAVE_INTROSPECTION_TRUE@Dbusmenu_0_4_gir_FILES = $(introspection_sources)
@HAVE_INTROSPECTION_TRUE@Dbusmenu_0_4_gir_NAMESPACE = Dbusmenu
@HAVE_INTROSPECTION_TRUE@Dbusmenu_0_4_gir_VERSION = 0.4
@HAVE_INTROSPECTION_TRUE@Dbusmenu_0_4_gir_EXPORT_PACKAGES = dbusmenu-glib-0.4
@@ -972,7 +987,7 @@ stamp-enum-types: $(glib_enum_headers)
$(glib_enum_h): stamp-enum-types
@true
-$(glib_enum_c): $(glib_enum_h)
+$(glib_enum_c): $(builddir)/$(glib_enum_h)
$(QUIET_GEN)mkdir -p `dirname $(builddir)/$(glib_enum_c)`
$(QUIET_GEN)$(GLIB_MKENUMS) \
--template $(srcdir)/$(enum_tmpl_c) \
diff --git a/libdbusmenu-glib/client-marshal.c b/libdbusmenu-glib/client-marshal.c
index 0614b69..1c58130 100644
--- a/libdbusmenu-glib/client-marshal.c
+++ b/libdbusmenu-glib/client-marshal.c
@@ -4,7 +4,7 @@
#ifdef G_ENABLE_DEBUG
#define g_marshal_value_peek_boolean(v) g_value_get_boolean (v)
-#define g_marshal_value_peek_char(v) g_value_get_char (v)
+#define g_marshal_value_peek_char(v) g_value_get_schar (v)
#define g_marshal_value_peek_uchar(v) g_value_get_uchar (v)
#define g_marshal_value_peek_int(v) g_value_get_int (v)
#define g_marshal_value_peek_uint(v) g_value_get_uint (v)
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c
index 9129db5..a2330d1 100644
--- a/libdbusmenu-glib/client.c
+++ b/libdbusmenu-glib/client.c
@@ -331,7 +331,7 @@ dbusmenu_client_class_init (DbusmenuClientClass *klass)
return;
}
-#define LAYOUT_PROPS_COUNT 5
+#define LAYOUT_PROPS_COUNT 6
static void
dbusmenu_client_init (DbusmenuClient *self)
@@ -359,6 +359,7 @@ dbusmenu_client_init (DbusmenuClient *self)
layout_props[2] = DBUSMENU_MENUITEM_PROP_VISIBLE;
layout_props[3] = DBUSMENU_MENUITEM_PROP_ENABLED;
layout_props[4] = DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY;
+ layout_props[5] = DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC;
layout_props[LAYOUT_PROPS_COUNT] = NULL;
priv->layout_props = g_variant_new_strv((const gchar * const *)layout_props, LAYOUT_PROPS_COUNT);
g_variant_ref_sink(priv->layout_props);
diff --git a/libdbusmenu-glib/dbusmenu-glib-0.4.pc.in b/libdbusmenu-glib/dbusmenu-glib-0.4.pc.in
index 31a1eac..fd71acf 100644
--- a/libdbusmenu-glib/dbusmenu-glib-0.4.pc.in
+++ b/libdbusmenu-glib/dbusmenu-glib-0.4.pc.in
@@ -4,7 +4,7 @@ libdir=@libdir@
bindir=@bindir@
includedir=@includedir@
-Cflags: -I${includedir}/libdbusmenu-0.4
+Cflags: -I${includedir}/libdbusmenu-glib-0.4
Requires:
Libs: -L${libdir} -ldbusmenu-glib
diff --git a/libdbusmenu-glib/defaults.c b/libdbusmenu-glib/defaults.c
index a5caf0b..d6ee7cc 100644
--- a/libdbusmenu-glib/defaults.c
+++ b/libdbusmenu-glib/defaults.c
@@ -83,11 +83,13 @@ dbusmenu_defaults_init (DbusmenuDefaults *self)
dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_ENABLED, G_VARIANT_TYPE_BOOLEAN, g_variant_new_boolean(TRUE));
dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_LABEL, G_VARIANT_TYPE_STRING, g_variant_new_string(_("Label Empty")));
dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_ICON_NAME, G_VARIANT_TYPE_STRING, NULL);
+ dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_ICON_DATA, G_VARIANT_TYPE("ay"), NULL);
dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE, G_VARIANT_TYPE_STRING, NULL);
dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_TOGGLE_STATE, G_VARIANT_TYPE_INT32, NULL);
dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_SHORTCUT, G_VARIANT_TYPE("aas"), NULL);
dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY, G_VARIANT_TYPE_STRING, NULL);
dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_DISPOSITION, G_VARIANT_TYPE_STRING, g_variant_new_string(DBUSMENU_MENUITEM_DISPOSITION_NORMAL));
+ dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC,G_VARIANT_TYPE_STRING, NULL);
/* Separator defaults */
dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_SEPARATOR, DBUSMENU_MENUITEM_PROP_VISIBLE, G_VARIANT_TYPE_BOOLEAN, g_variant_new_boolean(TRUE));
diff --git a/libdbusmenu-glib/menuitem-marshal.c b/libdbusmenu-glib/menuitem-marshal.c
index de227fd..ceacc77 100644
--- a/libdbusmenu-glib/menuitem-marshal.c
+++ b/libdbusmenu-glib/menuitem-marshal.c
@@ -4,7 +4,7 @@
#ifdef G_ENABLE_DEBUG
#define g_marshal_value_peek_boolean(v) g_value_get_boolean (v)
-#define g_marshal_value_peek_char(v) g_value_get_char (v)
+#define g_marshal_value_peek_char(v) g_value_get_schar (v)
#define g_marshal_value_peek_uchar(v) g_value_get_uchar (v)
#define g_marshal_value_peek_int(v) g_value_get_int (v)
#define g_marshal_value_peek_uint(v) g_value_get_uint (v)
diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c
index c9c7736..30ae277 100644
--- a/libdbusmenu-glib/menuitem.c
+++ b/libdbusmenu-glib/menuitem.c
@@ -1127,6 +1127,32 @@ dbusmenu_menuitem_property_set_int (DbusmenuMenuitem * mi, const gchar * propert
}
/**
+ * dbusmenu_menuitem_property_set_byte_array:
+ * @mi: The #DbusmenuMenuitem to set the property on.
+ * @property: Name of the property to set.
+ * @value: The byte array.
+ * @nelements: The number of elements in the byte array.
+ *
+ * Takes a byte array @value and sets it on @property as a
+ * property on @mi. If a property already exists by that name,
+ * then the value is set to the new value. If not, the property
+ * is added. If the value is changed or the property was previously
+ * unset then the signal #DbusmenuMenuitem::prop-changed will be
+ * emitted by this function.
+ *
+ * Return value: A boolean representing if the property value was set.
+ */
+gboolean
+dbusmenu_menuitem_property_set_byte_array (DbusmenuMenuitem * mi, const gchar * property, const guchar * value, gsize nelements)
+{
+ GVariant * variant = NULL;
+ if (value != NULL) {
+ variant = g_variant_new_fixed_array(G_VARIANT_TYPE_BYTE, value, nelements, sizeof(guchar));
+ }
+ return dbusmenu_menuitem_property_set_variant(mi, property, variant);
+}
+
+/**
* dbusmenu_menuitem_property_set_variant:
* @mi: The #DbusmenuMenuitem to set the property on.
* @property: Name of the property to set.
@@ -1360,6 +1386,31 @@ dbusmenu_menuitem_property_get_int (DbusmenuMenuitem * mi, const gchar * propert
return 0;
}
+/**
+ * dbusmenu_menuitem_property_get_byte_array:
+ * @mi: The #DbusmenuMenuitem to look for the property on.
+ * @property: The property to grab.
+ * @nelements: A pointer to the location to store the number of items (out)
+ *
+ * Look up a property on @mi and return the value of it if
+ * it exits. #NULL will be returned if the property doesn't
+ * exist.
+ *
+ * Return value: (array length=nelements)(element-type guint8)(transfer none): A byte array with the
+ * value of the property that shouldn't be free'd. Or #NULL if the property
+ * is not set or is not a byte array.
+ */
+const guchar *
+dbusmenu_menuitem_property_get_byte_array (DbusmenuMenuitem * mi, const gchar * property, gsize * nelements)
+{
+ GVariant * variant = dbusmenu_menuitem_property_get_variant(mi, property);
+ if (variant == NULL) {
+ *nelements = 0;
+ return NULL;
+ }
+ if (!g_variant_type_equal(g_variant_get_type(variant), G_VARIANT_TYPE("ay"))) return NULL;
+ return g_variant_get_fixed_array(variant, nelements, sizeof(guchar));
+}
/**
* dbusmenu_menuitem_property_exist:
diff --git a/libdbusmenu-glib/menuitem.h b/libdbusmenu-glib/menuitem.h
index 985e1a3..76422f9 100644
--- a/libdbusmenu-glib/menuitem.h
+++ b/libdbusmenu-glib/menuitem.h
@@ -154,6 +154,18 @@ G_BEGIN_DECLS
*/
#define DBUSMENU_MENUITEM_PROP_ICON_DATA "icon-data"
/**
+ * DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC:
+ *
+ * #DbusmenuMenuitem property used to provide a textual description of any
+ * information that the icon may convey. The contents of this property are
+ * passed through to assistive technologies such as the Orca screen reader.
+ * The contents of this property will not be visible in the menu item. If
+ * this property is set, Orca will use this property instead of the label
+ * property.
+ * Type: #G_VARIANT_TYPE_STRING
+ */
+#define DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC "accessible-desc"
+/**
* DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE:
*
* #DbusmenuMenuitem property that says what type of toggle entry should
@@ -485,10 +497,12 @@ gboolean dbusmenu_menuitem_property_set (DbusmenuMenuitem * mi, const gchar * pr
gboolean dbusmenu_menuitem_property_set_variant (DbusmenuMenuitem * mi, const gchar * property, GVariant * value);
gboolean dbusmenu_menuitem_property_set_bool (DbusmenuMenuitem * mi, const gchar * property, const gboolean value);
gboolean dbusmenu_menuitem_property_set_int (DbusmenuMenuitem * mi, const gchar * property, const gint value);
+gboolean dbusmenu_menuitem_property_set_byte_array (DbusmenuMenuitem * mi, const gchar * property, const guchar * value, gsize nelements);
const gchar * dbusmenu_menuitem_property_get (DbusmenuMenuitem * mi, const gchar * property);
GVariant * dbusmenu_menuitem_property_get_variant (DbusmenuMenuitem * mi, const gchar * property);
gboolean dbusmenu_menuitem_property_get_bool (DbusmenuMenuitem * mi, const gchar * property);
gint dbusmenu_menuitem_property_get_int (DbusmenuMenuitem * mi, const gchar * property);
+const guchar * dbusmenu_menuitem_property_get_byte_array (DbusmenuMenuitem * mi, const gchar * property, gsize * nelements);
gboolean dbusmenu_menuitem_property_exist (DbusmenuMenuitem * mi, const gchar * property);
GList * dbusmenu_menuitem_properties_list (DbusmenuMenuitem * mi) G_GNUC_WARN_UNUSED_RESULT;
GHashTable * dbusmenu_menuitem_properties_copy (DbusmenuMenuitem * mi);
diff --git a/libdbusmenu-glib/server-marshal.c b/libdbusmenu-glib/server-marshal.c
index 61393f4..20c20cc 100644
--- a/libdbusmenu-glib/server-marshal.c
+++ b/libdbusmenu-glib/server-marshal.c
@@ -4,7 +4,7 @@
#ifdef G_ENABLE_DEBUG
#define g_marshal_value_peek_boolean(v) g_value_get_boolean (v)
-#define g_marshal_value_peek_char(v) g_value_get_char (v)
+#define g_marshal_value_peek_char(v) g_value_get_schar (v)
#define g_marshal_value_peek_uchar(v) g_value_get_uchar (v)
#define g_marshal_value_peek_int(v) g_value_get_int (v)
#define g_marshal_value_peek_uint(v) g_value_get_uint (v)
diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c
index 9c085f7..4890d37 100644
--- a/libdbusmenu-glib/server.c
+++ b/libdbusmenu-glib/server.c
@@ -54,6 +54,7 @@ struct _DbusmenuServerPrivate
guint layout_idle;
GDBusConnection * bus;
+ guint find_server_signal;
GCancellable * bus_lookup;
guint dbus_registration;
@@ -191,6 +192,14 @@ static void bus_event (DbusmenuServer * server,
static void bus_about_to_show (DbusmenuServer * server,
GVariant * params,
GDBusMethodInvocation * invocation);
+static void find_servers_cb (GDBusConnection * connection,
+ const gchar * sender,
+ const gchar * path,
+ const gchar * interface,
+ const gchar * signal,
+ GVariant * params,
+ gpointer user_data);
+static gboolean layout_update_idle (gpointer user_data);
/* Globals */
static GDBusNodeInfo * dbusmenu_node_info = NULL;
@@ -366,6 +375,7 @@ dbusmenu_server_init (DbusmenuServer *self)
priv->layout_idle = 0;
priv->bus = NULL;
priv->bus_lookup = NULL;
+ priv->find_server_signal = 0;
priv->dbus_registration = 0;
default_text_direction(self);
@@ -405,6 +415,11 @@ dbusmenu_server_dispose (GObject *object)
priv->dbus_registration = 0;
}
+ if (priv->find_server_signal != 0) {
+ g_dbus_connection_signal_unsubscribe(priv->bus, priv->find_server_signal);
+ priv->find_server_signal = 0;
+ }
+
if (priv->bus != NULL) {
g_object_unref(priv->bus);
priv->bus = NULL;
@@ -706,12 +721,32 @@ bus_got_cb (GObject * obj, GAsyncResult * result, gpointer user_data)
DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(user_data);
priv->bus = bus;
+ priv->find_server_signal = g_dbus_connection_signal_subscribe(priv->bus,
+ NULL, /* sender */
+ "com.canonical.dbusmenu", /* interface */
+ "FindServers", /* member */
+ NULL, /* object path */
+ NULL, /* arg0 */
+ G_DBUS_SIGNAL_FLAGS_NONE, /* flags */
+ find_servers_cb, /* cb */
+ user_data, /* data */
+ NULL); /* free func */
+
register_object(DBUSMENU_SERVER(user_data));
g_object_unref(G_OBJECT(user_data));
return;
}
+/* Respond to the find servers signal by sending an update
+ to the bus */
+static void
+find_servers_cb (GDBusConnection * connection, const gchar * sender, const gchar * path, const gchar * interface, const gchar * signal, GVariant * params, gpointer user_data)
+{
+ layout_update_idle(user_data);
+ return;
+}
+
/* Function for the GDBus vtable to handle all method calls and dish
them out the appropriate functions */
static void