aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libdbusmenu-glib/defaults.c2
-rw-r--r--libdbusmenu-glib/menuitem.c13
-rw-r--r--libdbusmenu-glib/server.c8
-rw-r--r--libdbusmenu-gtk/parser.c6
4 files changed, 25 insertions, 4 deletions
diff --git a/libdbusmenu-glib/defaults.c b/libdbusmenu-glib/defaults.c
index c05ef38..9eaf9e5 100644
--- a/libdbusmenu-glib/defaults.c
+++ b/libdbusmenu-glib/defaults.c
@@ -30,7 +30,7 @@ License version 3 and version 2.1 along with this program. If not, see
#include "config.h"
#endif
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include "defaults.h"
#include "menuitem.h"
diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c
index 5202aa1..34147a3 100644
--- a/libdbusmenu-glib/menuitem.c
+++ b/libdbusmenu-glib/menuitem.c
@@ -1670,11 +1670,22 @@ 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;
g_signal_emit(G_OBJECT(mi), signals[EVENT], g_quark_from_string(name), name, variant, timestamp, &handled);
if (!handled && class->handle_event != NULL) {
- return class->handle_event(mi, name, variant, timestamp);
+ class->handle_event(mi, name, variant, timestamp);
+ }
+
+ if (variant != NULL) {
+ g_variant_unref(variant);
}
return;
diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c
index 056d6cb..7c943b2 100644
--- a/libdbusmenu-glib/server.c
+++ b/libdbusmenu-glib/server.c
@@ -30,7 +30,7 @@ License version 3 and version 2.1 along with this program. If not, see
#include "config.h"
#endif
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <gio/gio.h>
#include "menuitem-private.h"
@@ -1180,7 +1180,11 @@ bus_get_layout (DbusmenuServer * server, GVariant * params, GDBusMethodInvocatio
GVariant * items = NULL;
if (priv->root != NULL) {
- items = dbusmenu_menuitem_build_variant(priv->root, props, recurse);
+ DbusmenuMenuitem * mi = dbusmenu_menuitem_find_id(priv->root, parent);
+
+ if (mi != NULL) {
+ items = dbusmenu_menuitem_build_variant(mi, props, recurse);
+ }
}
/* What happens if we don't have anything? */
diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c
index 97f7979..8045b7f 100644
--- a/libdbusmenu-gtk/parser.c
+++ b/libdbusmenu-gtk/parser.c
@@ -129,6 +129,12 @@ parse_data_free (gpointer data)
if (pdata != NULL && pdata->widget != NULL) {
g_signal_handlers_disconnect_matched(pdata->widget, (GSignalMatchType)G_SIGNAL_MATCH_FUNC,
0, 0, NULL, G_CALLBACK(widget_notify_cb), NULL);
+ g_signal_handlers_disconnect_matched(pdata->widget, (GSignalMatchType)G_SIGNAL_MATCH_FUNC,
+ 0, 0, NULL, G_CALLBACK(accel_changed), NULL);
+ g_signal_handlers_disconnect_matched(pdata->widget, (GSignalMatchType)G_SIGNAL_MATCH_FUNC,
+ 0, 0, NULL, G_CALLBACK(checkbox_toggled), NULL);
+ g_signal_handlers_disconnect_matched(pdata->widget, (GSignalMatchType)G_SIGNAL_MATCH_FUNC,
+ 0, 0, NULL, G_CALLBACK(menuitem_notify_cb), NULL);
g_object_remove_weak_pointer(G_OBJECT(pdata->widget), (gpointer*)&pdata->widget);
}