aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-glib/menuitem.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdbusmenu-glib/menuitem.c')
-rw-r--r--libdbusmenu-glib/menuitem.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c
index bdaf49f..4e037ee 100644
--- a/libdbusmenu-glib/menuitem.c
+++ b/libdbusmenu-glib/menuitem.c
@@ -575,7 +575,7 @@ dbusmenu_menuitem_set_realized (DbusmenuMenuitem * mi)
* has. The list is valid until another child related function
* is called, where it might be changed.
*
- * Return value: (transfer none): A #GList of pointers to #DbusmenuMenuitem objects.
+ * Return value: (transfer none) (element-type Dbusmenu.Menuitem): A #GList of pointers to #DbusmenuMenuitem objects.
*/
GList *
dbusmenu_menuitem_get_children (DbusmenuMenuitem * mi)
@@ -1694,25 +1694,20 @@ dbusmenu_menuitem_handle_event (DbusmenuMenuitem * mi, const gchar * name, GVari
#endif
DbusmenuMenuitemClass * class = DBUSMENU_MENUITEM_GET_CLASS(mi);
- /* We need to keep a ref to the variant because the signal
- handler will drop the floating ref and then we'll be up
- a creek if we don't have our own later. */
- if (variant != NULL) {
- g_variant_ref_sink(variant);
+ gboolean handled = FALSE;
+ if (variant == NULL) {
+ variant = g_variant_new_int32(0);
}
- gboolean handled = FALSE;
+ g_variant_ref_sink(variant);
+
g_signal_emit(G_OBJECT(mi), signals[EVENT], g_quark_from_string(name), name, variant, timestamp, &handled);
if (!handled && class->handle_event != NULL) {
class->handle_event(mi, name, variant, timestamp);
}
- if (variant != NULL) {
- g_variant_unref(variant);
- }
-
- return;
+ g_variant_unref(variant);
}
/**