diff options
author | Ted Gould <ted@gould.cx> | 2011-02-23 09:36:15 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-02-23 09:36:15 -0600 |
commit | d69242596c18abf533cabb4eba80b5200496349d (patch) | |
tree | f24e3b6d8330dcfb1358a2fadd0ebe0bbfb2e3d0 | |
parent | 1f74c94ab3fe43c628fba75ec62fa10b6347d2c7 (diff) | |
download | libdbusmenu-d69242596c18abf533cabb4eba80b5200496349d.tar.gz libdbusmenu-d69242596c18abf533cabb4eba80b5200496349d.tar.bz2 libdbusmenu-d69242596c18abf533cabb4eba80b5200496349d.zip |
Switch signal handler to return bool so that we can signal if someone has handled it
-rw-r--r-- | libdbusmenu-glib/menuitem-marshal.list | 2 | ||||
-rw-r--r-- | libdbusmenu-glib/menuitem.c | 13 |
2 files changed, 8 insertions, 7 deletions
diff --git a/libdbusmenu-glib/menuitem-marshal.list b/libdbusmenu-glib/menuitem-marshal.list index b2e02e5..4382ed7 100644 --- a/libdbusmenu-glib/menuitem-marshal.list +++ b/libdbusmenu-glib/menuitem-marshal.list @@ -4,4 +4,4 @@ VOID: OBJECT, UINT VOID: OBJECT VOID: VOID VOID: UINT -VOID: STRING, VARIANT, UINT +BOOLEAN: STRING, VARIANT, UINT diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c index d8ae1a1..d420fd6 100644 --- a/libdbusmenu-glib/menuitem.c +++ b/libdbusmenu-glib/menuitem.c @@ -261,9 +261,9 @@ dbusmenu_menuitem_class_init (DbusmenuMenuitemClass *klass) G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET(DbusmenuMenuitemClass, event), - NULL, NULL, - _dbusmenu_menuitem_marshal_VOID__STRING_VARIANT_UINT, - G_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_VARIANT, G_TYPE_UINT); + g_signal_accumulator_true_handled, NULL, + _dbusmenu_menuitem_marshal_BOOLEAN__STRING_VARIANT_UINT, + G_TYPE_BOOLEAN, 3, G_TYPE_STRING, G_TYPE_VARIANT, G_TYPE_UINT); g_object_class_install_property (object_class, PROP_ID, g_param_spec_int(PROP_ID_S, "ID for the menu item", @@ -1533,12 +1533,13 @@ dbusmenu_menuitem_handle_event (DbusmenuMenuitem * mi, const gchar * name, GVari #endif DbusmenuMenuitemClass * class = DBUSMENU_MENUITEM_GET_CLASS(mi); - if (class->handle_event != NULL) { + gboolean handled = FALSE; + g_signal_emit(G_OBJECT(mi), EVENT, g_quark_from_string(name), name, variant, timestamp, &handled); + + if (!handled && class->handle_event != NULL) { return class->handle_event(mi, name, variant, timestamp); } - g_signal_emit(G_OBJECT(mi), EVENT, g_quark_from_string(name), name, variant, timestamp, TRUE); - return; } |