diff options
author | Ted Gould <ted@gould.cx> | 2011-03-03 13:48:56 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-03-03 13:48:56 -0600 |
commit | df8c5e53a6fddcd80e2ea52174f9242c2c17eba4 (patch) | |
tree | 26fe9c9337b8c8eead223035698ce164da8c5ac6 /libdbusmenu-gtk | |
parent | bf0ec7cdc8c37f4ec7668f18b0be10942564957b (diff) | |
parent | a66d4b41bfd368a4ac3c25be748cf64203147007 (diff) | |
download | libdbusmenu-df8c5e53a6fddcd80e2ea52174f9242c2c17eba4.tar.gz libdbusmenu-df8c5e53a6fddcd80e2ea52174f9242c2c17eba4.tar.bz2 libdbusmenu-df8c5e53a6fddcd80e2ea52174f9242c2c17eba4.zip |
* New upstream release.
* GTK application menus are not correctly displayed (LP: #726678)
* Fix LP: #723873 - ensure that changing a menuitem property to a
default value gets propagated properly in the client
* Fix some crashes by disconnecting more signals when a menuitem is
deleted. LP: #725980 and LP: #726153
* Making sure to grab the variant and dispose of it in handle_event.
* Change the destroy prototype to fix GIR warnings
* Fix emitting property changes to use tuples
* Track the icon theme directories
* Handle cases where passed in property names could be in the
properties hash table
* Making property names match DBus protocol recommendations
* Restricting GIR scanner to exported interfaces
* Use the library i18n libraries instead of the app ones
* Make GetLayout use the parent parameter
Diffstat (limited to 'libdbusmenu-gtk')
-rw-r--r-- | libdbusmenu-gtk/menuitem.c | 4 | ||||
-rw-r--r-- | libdbusmenu-gtk/parser.c | 35 | ||||
-rw-r--r-- | libdbusmenu-gtk/serializablemenuitem.c | 4 |
3 files changed, 32 insertions, 11 deletions
diff --git a/libdbusmenu-gtk/menuitem.c b/libdbusmenu-gtk/menuitem.c index 508b43f..370dbf2 100644 --- a/libdbusmenu-gtk/menuitem.c +++ b/libdbusmenu-gtk/menuitem.c @@ -177,6 +177,9 @@ dbusmenu_menuitem_property_set_shortcut (DbusmenuMenuitem * menuitem, guint key, g_return_val_if_fail(DBUSMENU_IS_MENUITEM(menuitem), FALSE); g_return_val_if_fail(gtk_accelerator_valid(key, modifier), FALSE); + const gchar * keyname = gdk_keyval_name(key); + g_return_val_if_fail(keyname != NULL, FALSE); + GVariantBuilder builder; g_variant_builder_init(&builder, G_VARIANT_TYPE_ARRAY); @@ -193,7 +196,6 @@ dbusmenu_menuitem_property_set_shortcut (DbusmenuMenuitem * menuitem, guint key, g_variant_builder_add(&builder, "s", DBUSMENU_MENUITEM_SHORTCUT_SUPER); } - const gchar * keyname = gdk_keyval_name(key); g_variant_builder_add(&builder, "s", keyname); GVariant * inside = g_variant_builder_end(&builder); diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c index 97f7979..cf2003f 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); } @@ -149,6 +155,14 @@ parse_data_free (gpointer data) return; } +static void +widget_freed (gpointer data, GObject * obj) +{ + g_signal_handlers_disconnect_by_func(gtk_icon_theme_get_default(), G_CALLBACK(theme_changed_cb), obj); + + return; +} + /* Called when the dbusmenu item that we're keeping around is finalized */ static void @@ -157,18 +171,12 @@ dbusmenu_item_freed (gpointer data, GObject * obj) ParserData *pdata = (ParserData *)g_object_get_data(G_OBJECT(obj), PARSER_DATA); if (pdata != NULL && pdata->widget != NULL) { + g_signal_handlers_disconnect_by_func(gtk_icon_theme_get_default(), G_CALLBACK(theme_changed_cb), pdata->widget); g_object_steal_data(G_OBJECT(pdata->widget), CACHED_MENUITEM); + g_object_weak_unref(G_OBJECT(pdata->widget), widget_freed, NULL); } } -static void -widget_freed (gpointer data, GObject * obj) -{ - g_signal_handlers_disconnect_by_func(gtk_icon_theme_get_default(), G_CALLBACK(theme_changed_cb), obj); - - return; -} - /* Gets the positon of the child with its' parent if it has one. Returns -1 if the position is unable to be calculated. */ static gint @@ -450,6 +458,17 @@ construct_dbusmenu_for_widget (GtkWidget * widget) } } + GtkWidget *submenu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(widget)); + if (submenu) + { + pdata->shell = submenu; + g_signal_connect (G_OBJECT (submenu), + "child-added", + G_CALLBACK (child_added_cb), + mi); + g_object_add_weak_pointer(G_OBJECT(submenu), (gpointer*)&pdata->shell); + } + if (!g_object_get_data (G_OBJECT (widget), "gtk-empty-menu-item") && !GTK_IS_TEAROFF_MENU_ITEM (widget)) { visible = gtk_widget_get_visible (widget); diff --git a/libdbusmenu-gtk/serializablemenuitem.c b/libdbusmenu-gtk/serializablemenuitem.c index 29f83a8..b560fe3 100644 --- a/libdbusmenu-gtk/serializablemenuitem.c +++ b/libdbusmenu-gtk/serializablemenuitem.c @@ -215,7 +215,7 @@ type_handler (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuCli /* Destruction is inevitable */ static void -type_destroy_handler (DbusmenuClient * client, const gchar * type, gpointer user_data) +type_destroy_handler (gpointer user_data) { g_return_if_fail(user_data != NULL); type_handler_t * th = (type_handler_t *)user_data; @@ -255,7 +255,7 @@ dbusmenu_gtk_serializable_menu_item_register_to_client (DbusmenuClient * client, th->class = class; th->type = item_type; if (!dbusmenu_client_add_type_handler_full(client, class->get_type_string(), type_handler, th, type_destroy_handler)) { - type_destroy_handler(client, class->get_type_string(), th); + type_destroy_handler(th); } /* Register defaults */ |