From 39d4b10daeee829c8568491fd5268a15ecff4bf9 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 11 Apr 2012 17:40:03 -0500 Subject: apply Evan Nemerson's patch to make the Vala binidngs use pkg-config names, not GIR names, so that valac can automatically pick up the relevant libraries and flags. --- libdbusmenu-glib/Makefile.am | 6 +++--- libdbusmenu-gtk/Makefile.am | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libdbusmenu-glib/Makefile.am b/libdbusmenu-glib/Makefile.am index b2e796c..7fe8030 100644 --- a/libdbusmenu-glib/Makefile.am +++ b/libdbusmenu-glib/Makefile.am @@ -216,10 +216,10 @@ if HAVE_VALA if HAVE_INTROSPECTION vapidir = $(datadir)/vala/vapi -vapi_DATA = Dbusmenu-0.4.vapi +vapi_DATA = dbusmenu-glib-0.4.vapi -Dbusmenu-0.4.vapi: Dbusmenu-0.4.gir - $(VALA_API_GEN) --library=Dbusmenu-0.4 $< +dbusmenu-glib-0.4.vapi: Dbusmenu-0.4.gir + $(VALA_API_GEN) --library=dbusmenu-glib-0.4 $< CLEANFILES += $(vapi_DATA) diff --git a/libdbusmenu-gtk/Makefile.am b/libdbusmenu-gtk/Makefile.am index b52098f..a255a69 100644 --- a/libdbusmenu-gtk/Makefile.am +++ b/libdbusmenu-gtk/Makefile.am @@ -160,14 +160,14 @@ if HAVE_VALA if HAVE_INTROSPECTION vapidir = $(datadir)/vala/vapi -vapi_DATA = DbusmenuGtk$(VER)-0.4.vapi +vapi_DATA = dbusmenu-gtk$(VER)-0.4.vapi -DbusmenuGtk$(VER)-0.4.vapi: DbusmenuGtk$(VER)-0.4.tmp.gir Makefile.am - $(VALA_API_GEN) --library=DbusmenuGtk$(VER)-0.4 \ +dbusmenu-gtk$(VER)-0.4.vapi: DbusmenuGtk$(VER)-0.4.tmp.gir Makefile.am + $(VALA_API_GEN) --library=dbusmenu-gtk$(VER)-0.4 \ --pkg gdk-pixbuf-2.0 \ --pkg $(GTKVALA) \ --pkg atk \ - --pkg Dbusmenu-0.4 \ + --pkg dbusmenu-glib-0.4 \ --vapidir=$(top_builddir)/libdbusmenu-glib \ $< -- cgit v1.2.3 From 678a41767787d26f624d38bd573e8c5a36fc72e0 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sat, 14 Apr 2012 12:52:48 -0500 Subject: fix leaky DbusmenuServer.priv.dbusobject --- libdbusmenu-glib/server.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 9e5ef0c..f47bb5d 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -463,6 +463,11 @@ dbusmenu_server_finalize (GObject *object) { DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(object); + if (priv->dbusobject != NULL) { + g_free (priv->dbusobject); + priv->dbusobject = NULL; + } + if (priv->icon_dirs != NULL) { g_strfreev(priv->icon_dirs); priv->icon_dirs = NULL; -- cgit v1.2.3 From fca9a5705ac81654b8fe848fb166af94618382b0 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 23 Apr 2012 12:48:49 -0500 Subject: Static is probably better to ensure we don't get out of the binary --- libdbusmenu-gtk/genericmenuitem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdbusmenu-gtk/genericmenuitem.c b/libdbusmenu-gtk/genericmenuitem.c index 33d888d..a06485d 100644 --- a/libdbusmenu-gtk/genericmenuitem.c +++ b/libdbusmenu-gtk/genericmenuitem.c @@ -242,7 +242,7 @@ has_mnemonic (const gchar * string, gboolean previous_underscore) } /* Sanitize the label by removing "__" meaning "_" */ -G_INLINE_FUNC gchar * +static gchar * sanitize_label (const gchar * in_label) { static GRegex * underscore_regex = NULL; -- cgit v1.2.3 From 75814c2cb059475555bb40120f2fa510e2d9ea45 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 25 Apr 2012 10:38:49 -0500 Subject: constify the dbusmenu_menuitem_get*() functions --- libdbusmenu-glib/menuitem.c | 14 +++++++------- libdbusmenu-glib/menuitem.h | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c index c81c36e..cfc6bc3 100644 --- a/libdbusmenu-glib/menuitem.c +++ b/libdbusmenu-glib/menuitem.c @@ -463,7 +463,7 @@ send_about_to_show (DbusmenuMenuitem * mi, void (*cb) (DbusmenuMenuitem * mi, gp /* A helper function to get the type of the menuitem, this might be a candidate for optimization in the future. */ static const gchar * -menuitem_get_type (DbusmenuMenuitem * mi) +menuitem_get_type (const DbusmenuMenuitem * mi) { DbusmenuMenuitemPrivate * priv = DBUSMENU_MENUITEM_GET_PRIVATE(mi); GVariant * currentval = (GVariant *)g_hash_table_lookup(priv->properties, DBUSMENU_MENUITEM_PROP_TYPE); @@ -1287,7 +1287,7 @@ dbusmenu_menuitem_property_set_variant (DbusmenuMenuitem * mi, const gchar * pro * is not set or is not a string. */ const gchar * -dbusmenu_menuitem_property_get (DbusmenuMenuitem * mi, const gchar * property) +dbusmenu_menuitem_property_get (const DbusmenuMenuitem * mi, const gchar * property) { GVariant * variant = dbusmenu_menuitem_property_get_variant(mi, property); if (variant == NULL) return NULL; @@ -1307,7 +1307,7 @@ dbusmenu_menuitem_property_get (DbusmenuMenuitem * mi, const gchar * property) * Return value: (transfer none): A GVariant for the property. */ GVariant * -dbusmenu_menuitem_property_get_variant (DbusmenuMenuitem * mi, const gchar * property) +dbusmenu_menuitem_property_get_variant (const DbusmenuMenuitem * mi, const gchar * property) { g_return_val_if_fail(DBUSMENU_IS_MENUITEM(mi), NULL); g_return_val_if_fail(property != NULL, NULL); @@ -1334,7 +1334,7 @@ dbusmenu_menuitem_property_get_variant (DbusmenuMenuitem * mi, const gchar * pro * Return value: The value of the property or #FALSE. */ gboolean -dbusmenu_menuitem_property_get_bool (DbusmenuMenuitem * mi, const gchar * property) +dbusmenu_menuitem_property_get_bool (const DbusmenuMenuitem * mi, const gchar * property) { GVariant * variant = dbusmenu_menuitem_property_get_variant(mi, property); if (variant == NULL) return FALSE; @@ -1368,7 +1368,7 @@ dbusmenu_menuitem_property_get_bool (DbusmenuMenuitem * mi, const gchar * proper * Return value: The value of the property or zero. */ gint -dbusmenu_menuitem_property_get_int (DbusmenuMenuitem * mi, const gchar * property) +dbusmenu_menuitem_property_get_int (const DbusmenuMenuitem * mi, const gchar * property) { GVariant * variant = dbusmenu_menuitem_property_get_variant(mi, property); if (variant == NULL) return 0; @@ -1401,7 +1401,7 @@ dbusmenu_menuitem_property_get_int (DbusmenuMenuitem * mi, const gchar * propert * is not set or is not a byte array. */ const guchar * -dbusmenu_menuitem_property_get_byte_array (DbusmenuMenuitem * mi, const gchar * property, gsize * nelements) +dbusmenu_menuitem_property_get_byte_array (const DbusmenuMenuitem * mi, const gchar * property, gsize * nelements) { GVariant * variant = dbusmenu_menuitem_property_get_variant(mi, property); if (variant == NULL) { @@ -1423,7 +1423,7 @@ dbusmenu_menuitem_property_get_byte_array (DbusmenuMenuitem * mi, const gchar * * Return value: A boolean checking to see if the property is available */ gboolean -dbusmenu_menuitem_property_exist (DbusmenuMenuitem * mi, const gchar * property) +dbusmenu_menuitem_property_exist (const DbusmenuMenuitem * mi, const gchar * property) { g_return_val_if_fail(DBUSMENU_IS_MENUITEM(mi), FALSE); g_return_val_if_fail(property != NULL, FALSE); diff --git a/libdbusmenu-glib/menuitem.h b/libdbusmenu-glib/menuitem.h index 76422f9..d9e26cf 100644 --- a/libdbusmenu-glib/menuitem.h +++ b/libdbusmenu-glib/menuitem.h @@ -498,12 +498,12 @@ gboolean dbusmenu_menuitem_property_set_variant (DbusmenuMenuitem * mi, const gc 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); +const gchar * dbusmenu_menuitem_property_get (const DbusmenuMenuitem * mi, const gchar * property); +GVariant * dbusmenu_menuitem_property_get_variant (const DbusmenuMenuitem * mi, const gchar * property); +gboolean dbusmenu_menuitem_property_get_bool (const DbusmenuMenuitem * mi, const gchar * property); +gint dbusmenu_menuitem_property_get_int (const DbusmenuMenuitem * mi, const gchar * property); +const guchar * dbusmenu_menuitem_property_get_byte_array (const DbusmenuMenuitem * mi, const gchar * property, gsize * nelements); +gboolean dbusmenu_menuitem_property_exist (const DbusmenuMenuitem * mi, const gchar * property); GList * dbusmenu_menuitem_properties_list (DbusmenuMenuitem * mi) G_GNUC_WARN_UNUSED_RESULT; GHashTable * dbusmenu_menuitem_properties_copy (DbusmenuMenuitem * mi); void dbusmenu_menuitem_property_remove (DbusmenuMenuitem * mi, const gchar * property); -- cgit v1.2.3 From 92ce49aa3f1ecd493c33eca1c31233b9d1ca3c58 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 24 May 2012 10:10:28 +0200 Subject: don't include build-time filenames in comments of the enum header files If we do, the header files may be different on each build. This is especially harmful when building multiple times for multiple architectures and expecting the files to be identical. See: http://bugs.debian.org/674200 --- libdbusmenu-glib/enum-types.h.in | 2 +- libdbusmenu-gtk/genericmenuitem-enum-types.h.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libdbusmenu-glib/enum-types.h.in b/libdbusmenu-glib/enum-types.h.in index 5758438..afd9132 100644 --- a/libdbusmenu-glib/enum-types.h.in +++ b/libdbusmenu-glib/enum-types.h.in @@ -43,7 +43,7 @@ G_END_DECLS /*** END file-tail ***/ /*** BEGIN file-production ***/ -/* Enumerations from file: "@filename@" */ +/* Enumerations from file: "@basename@" */ #include "@basename@" /*** END file-production ***/ diff --git a/libdbusmenu-gtk/genericmenuitem-enum-types.h.in b/libdbusmenu-gtk/genericmenuitem-enum-types.h.in index 5758438..afd9132 100644 --- a/libdbusmenu-gtk/genericmenuitem-enum-types.h.in +++ b/libdbusmenu-gtk/genericmenuitem-enum-types.h.in @@ -43,7 +43,7 @@ G_END_DECLS /*** END file-tail ***/ /*** BEGIN file-production ***/ -/* Enumerations from file: "@filename@" */ +/* Enumerations from file: "@basename@" */ #include "@basename@" /*** END file-production ***/ -- cgit v1.2.3 From 75bdca54d5e6838aece55c84db3fd3249a624dfb Mon Sep 17 00:00:00 2001 From: Albert Astals Date: Mon, 4 Jun 2012 13:18:43 +0200 Subject: Replace & with & since we are using set_markup in the label --- libdbusmenu-gtk/genericmenuitem.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/libdbusmenu-gtk/genericmenuitem.c b/libdbusmenu-gtk/genericmenuitem.c index 75bdbbd..ab57e86 100644 --- a/libdbusmenu-gtk/genericmenuitem.c +++ b/libdbusmenu-gtk/genericmenuitem.c @@ -262,6 +262,27 @@ sanitize_label (const gchar * in_label) NULL); /* error */ } +/* Replace '&' with '&' in the label */ +static gchar * +replace_amps (const gchar * in_label) +{ + static GRegex * amp_regex = NULL; + + g_return_val_if_fail(in_label != NULL, NULL); + + if (amp_regex == NULL) { + amp_regex = g_regex_new("&", 0, 0, NULL); + } + + return g_regex_replace_literal(amp_regex, + in_label, + -1, /* length */ + 0, /* start */ + "&", /* replacement */ + 0, /* flags */ + NULL); /* error */ +} + /* Set the label on the item */ static void set_label (GtkMenuItem * menu_item, const gchar * in_label) @@ -338,11 +359,15 @@ set_label (GtkMenuItem * menu_item, const gchar * in_label) gtk_accel_label_set_accel_widget(GTK_ACCEL_LABEL(labelw), GTK_WIDGET(menu_item)); if (has_mnemonic(in_label, FALSE)) { + gchar * amp_replaced = replace_amps (local_label); gtk_label_set_use_underline(GTK_LABEL(labelw), TRUE); - gtk_label_set_markup_with_mnemonic(labelw, local_label); + gtk_label_set_markup_with_mnemonic(labelw, amp_replaced); + g_free(amp_replaced); } else { gchar * sanitized = sanitize_label(local_label); - gtk_label_set_markup(labelw, sanitized); + gchar * amp_replaced = replace_amps (sanitized); + gtk_label_set_markup(labelw, amp_replaced); + g_free(amp_replaced); g_free(sanitized); } -- cgit v1.2.3 From 9c77e28fb5485650e033a6cfb868785ea8f1dbad Mon Sep 17 00:00:00 2001 From: Albert Astals Date: Mon, 4 Jun 2012 15:29:56 +0200 Subject: Use g_markup_escape_text instead of manually trying to fix the text --- libdbusmenu-gtk/genericmenuitem.c | 31 +++---------------------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/libdbusmenu-gtk/genericmenuitem.c b/libdbusmenu-gtk/genericmenuitem.c index ab57e86..ae6d4c0 100644 --- a/libdbusmenu-gtk/genericmenuitem.c +++ b/libdbusmenu-gtk/genericmenuitem.c @@ -262,27 +262,6 @@ sanitize_label (const gchar * in_label) NULL); /* error */ } -/* Replace '&' with '&' in the label */ -static gchar * -replace_amps (const gchar * in_label) -{ - static GRegex * amp_regex = NULL; - - g_return_val_if_fail(in_label != NULL, NULL); - - if (amp_regex == NULL) { - amp_regex = g_regex_new("&", 0, 0, NULL); - } - - return g_regex_replace_literal(amp_regex, - in_label, - -1, /* length */ - 0, /* start */ - "&", /* replacement */ - 0, /* flags */ - NULL); /* error */ -} - /* Set the label on the item */ static void set_label (GtkMenuItem * menu_item, const gchar * in_label) @@ -300,7 +279,7 @@ set_label (GtkMenuItem * menu_item, const gchar * in_label) gchar * local_label = NULL; switch (GENERICMENUITEM(menu_item)->priv->disposition) { case GENERICMENUITEM_DISPOSITION_NORMAL: - local_label = g_strdup(in_label); + local_label = g_markup_escape_text(in_label, -1); break; case GENERICMENUITEM_DISPOSITION_INFORMATIONAL: case GENERICMENUITEM_DISPOSITION_WARNING: @@ -359,15 +338,11 @@ set_label (GtkMenuItem * menu_item, const gchar * in_label) gtk_accel_label_set_accel_widget(GTK_ACCEL_LABEL(labelw), GTK_WIDGET(menu_item)); if (has_mnemonic(in_label, FALSE)) { - gchar * amp_replaced = replace_amps (local_label); gtk_label_set_use_underline(GTK_LABEL(labelw), TRUE); - gtk_label_set_markup_with_mnemonic(labelw, amp_replaced); - g_free(amp_replaced); + gtk_label_set_markup_with_mnemonic(labelw, local_label); } else { gchar * sanitized = sanitize_label(local_label); - gchar * amp_replaced = replace_amps (sanitized); - gtk_label_set_markup(labelw, amp_replaced); - g_free(amp_replaced); + gtk_label_set_markup(labelw, sanitized); g_free(sanitized); } -- cgit v1.2.3 From 4fc9c62ab2356caeaac7fc7dd968bdf0cb838d46 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 12 Jun 2012 08:55:51 +0200 Subject: make pkg-config check not fail if valgrind was not found this allows to build and run non-valgrind checks on arches where valgrind is not available --- configure.ac | 3 ++- tests/Makefile.am | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 94bba0c..608e80d 100644 --- a/configure.ac +++ b/configure.ac @@ -121,7 +121,8 @@ PKG_CHECK_MODULES(DBUSMENUTESTS, json-glib-1.0 >= $JSON_GLIB_REQUIRED_VERSION gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION, [have_tests=yes] ) -PKG_CHECK_MODULES(DBUSMENUTESTSVALGRIND, valgrind) +PKG_CHECK_MODULES(DBUSMENUTESTSVALGRIND, valgrind, have_valgrind=yes, have_valgrind=no) +AM_CONDITIONAL([HAVE_VALGRIND], [test "x$have_valgrind" = "xyes"]) ]) AC_SUBST(DBUSMENUTESTS_CFLAGS) diff --git a/tests/Makefile.am b/tests/Makefile.am index df87dc8..c375562 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -16,10 +16,12 @@ TESTS = \ test-glib-submenu if WANT_DBUSMENUDUMPER +if HAVE_VALGRIND TESTS += \ test-json \ test-json-instruction endif +endif if WANT_LIBDBUSMENUGTK TESTS += \ @@ -59,10 +61,12 @@ check_PROGRAMS = \ test-glib-simple-items if WANT_DBUSMENUDUMPER +if HAVE_VALGRIND check_PROGRAMS += \ test-json-client \ test-json-server endif +endif if WANT_LIBDBUSMENUGTK check_PROGRAMS += \ -- cgit v1.2.3 From f1649bd94ffa9d4a32c7f1c9c989054d3dc56901 Mon Sep 17 00:00:00 2001 From: Michael Terry Date: Mon, 10 Sep 2012 11:30:56 -0400 Subject: pay attention to GtkSettings's gtk-menu-images value as it changes on the client end --- libdbusmenu-gtk/parser.c | 63 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c index 2f7277c..419c15f 100644 --- a/libdbusmenu-gtk/parser.c +++ b/libdbusmenu-gtk/parser.c @@ -60,6 +60,9 @@ typedef struct _ParserData gulong widget_accel_handler_id; gulong widget_toggle_handler_id; gulong widget_visible_handler_id; + gulong widget_screen_changed_handler_id; + + gulong settings_notify_handler_id; } ParserData; @@ -116,6 +119,12 @@ static void widget_notify_cb (GtkWidget * widget, static void widget_add_cb (GtkWidget * widget, GtkWidget * child, gpointer data); +static void widget_screen_changed_cb (GtkWidget * widget, + GdkScreen * old_screen, + gpointer data); +static void settings_notify_cb (GtkSettings * settings, + GParamSpec * pspec, + gpointer data); static gboolean should_show_image (GtkImage * image); static void menuitem_notify_cb (GtkWidget * widget, GParamSpec * pspec, @@ -130,6 +139,7 @@ static const char * interned_str_active = NULL; static const char * interned_str_always_show_image = NULL; static const char * interned_str_file = NULL; static const char * interned_str_gicon = NULL; +static const char * interned_str_gtk_menu_images = NULL; static const char * interned_str_icon_name = NULL; static const char * interned_str_icon_set = NULL; static const char * interned_str_image = NULL; @@ -155,6 +165,7 @@ ensure_interned_strings_loaded (void) interned_str_always_show_image = g_intern_static_string ("always-show-image"); interned_str_file = g_intern_static_string ("file"); interned_str_gicon = g_intern_static_string ("gicon"); + interned_str_gtk_menu_images = g_intern_static_string ("gtk-menu-images"); interned_str_icon_name = g_intern_static_string ("icon-name"); interned_str_icon_set = g_intern_static_string ("icon-set"); interned_str_image = g_intern_static_string ("image"); @@ -291,6 +302,9 @@ parser_data_free (ParserData * pdata) dbusmenu_gtk_clear_signal_handler (o, &pdata->widget_accel_handler_id); dbusmenu_gtk_clear_signal_handler (o, &pdata->widget_toggle_handler_id); dbusmenu_gtk_clear_signal_handler (o, &pdata->widget_visible_handler_id); + dbusmenu_gtk_clear_signal_handler (o, &pdata->widget_screen_changed_handler_id); + dbusmenu_gtk_clear_signal_handler (gtk_widget_get_settings (GTK_WIDGET (o)), + &pdata->settings_notify_handler_id); g_object_remove_weak_pointer(o, (gpointer*)&pdata->widget); /* since the DbusmenuMenuitem is being destroyed, uncache it from the GtkWidget */ @@ -746,6 +760,10 @@ construct_dbusmenu_for_widget (GtkWidget * widget) pdata->widget_add_handler_id = g_signal_connect (widget, "add", G_CALLBACK (widget_add_cb), mi); + pdata->widget_screen_changed_handler_id = g_signal_connect (widget, "screen-changed", + G_CALLBACK (widget_screen_changed_cb), mi); + widget_screen_changed_cb (widget, NULL, mi); + return mi; } @@ -1282,6 +1300,51 @@ widget_add_cb (GtkWidget *widget, handle_first_label (data); } +/* Pass NULL for pspec to update all settings at once */ +static void +widget_screen_changed_cb (GtkWidget * widget, GdkScreen * old_screen, gpointer data) +{ + DbusmenuMenuitem * mi = DBUSMENU_MENUITEM(data); + g_return_if_fail (mi != NULL); + + ParserData *pdata = (ParserData *)g_object_get_data(G_OBJECT(mi), PARSER_DATA); + + if (old_screen != NULL) + dbusmenu_gtk_clear_signal_handler (gtk_settings_get_for_screen (old_screen), + &pdata->settings_notify_handler_id); + pdata->settings_notify_handler_id = g_signal_connect (gtk_widget_get_settings (widget), "notify", + G_CALLBACK (settings_notify_cb), mi); + + /* And update widget now that we have a new GtkSettings */ + settings_notify_cb (gtk_widget_get_settings (widget), NULL, mi); +} + +/* Pass NULL for pspec to update all settings at once */ +static void +settings_notify_cb (GtkSettings * settings, GParamSpec * pspec, gpointer data) +{ + GValue prop_value = {0}; + DbusmenuMenuitem * mi = DBUSMENU_MENUITEM(data); + g_return_if_fail (mi != NULL); + + ensure_interned_strings_loaded (); + + if (pspec != NULL) + { + g_value_init (&prop_value, pspec->value_type); + g_object_get_property (G_OBJECT (settings), pspec->name, &prop_value); + } + + if (pspec == NULL || pspec->name == interned_str_gtk_menu_images) + { + ParserData *pdata = (ParserData *)g_object_get_data(G_OBJECT(mi), PARSER_DATA); + update_icon (mi, pdata, GTK_IMAGE(pdata->image)); + } + + if (pspec != NULL) + g_value_unset (&prop_value); +} + /* A child item was added to a menu we're watching. Let's try to integrate it. */ static void item_inserted_cb (GtkContainer *menu, -- cgit v1.2.3 From 6de882725e55bbda37113773918478349a7c45b9 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 19 Sep 2012 12:10:01 -0500 Subject: 12.10.0 --- NEWS | 8 ++++++++ configure.ac | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index e69de29..95fef36 100644 --- a/NEWS +++ b/NEWS @@ -0,0 +1,8 @@ +12.10.0 + - Honor changes to GtkSettings' gtk-menu-images value (lp: #927236) + - don't display an underscore on menuitimes containing a '&' (lp: #994564) + - set the widget for the accelerator even if there isn't a mnemonic (lp: #982656) + - make the vala bindings use pkg-config names, rather than gir ones + - Some platforms don't have valgrind, so treat those unit tests separately + - make headers match independent of the build directory + - constify some public API calls diff --git a/configure.ac b/configure.ac index 608e80d..e0c61bd 100644 --- a/configure.ac +++ b/configure.ac @@ -1,11 +1,11 @@ -AC_INIT(libdbusmenu, 0.6.1, ted@canonical.com) +AC_INIT(libdbusmenu, 12.10.0, ted@canonical.com) AC_COPYRIGHT([Copyright 2009,2010 Canonical]) AC_PREREQ(2.62) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(libdbusmenu, 0.6.1, [-Wno-portability]) +AM_INIT_AUTOMAKE(libdbusmenu, 12.10.0, [-Wno-portability]) AM_MAINTAINER_MODE -- cgit v1.2.3 From 8f64d9a61a64ed3b0ff7b1248a2d8f92524907e2 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 19 Sep 2012 18:55:27 -0500 Subject: in the test-json and test-json-instruction unit tests, don't tell dbus-test-runner to ignore the server & clients' return values --- tests/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index c375562..0cd68d0 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -237,7 +237,7 @@ test-json: test-json-client test-json-server Makefile.am @echo export UBUNTU_MENUPROXY="" >> $@ @echo export G_DEBUG=fatal_criticals >> $@ @echo $(XVFB_RUN) >> $@ - @echo $(DBUS_RUNNER) --task ./test-json-client --wait-for org.dbusmenu.test --task-name Client --parameter $(top_builddir)/tools/dbusmenu-dumper --parameter test-json-01.output.json --ignore-return --task ./test-json-server --task-name Server --parameter $(srcdir)/test-json-01.json --ignore-return >> $@ + @echo $(DBUS_RUNNER) --task ./test-json-client --wait-for org.dbusmenu.test --task-name Client --parameter $(top_builddir)/tools/dbusmenu-dumper --parameter test-json-01.output.json --task ./test-json-server --task-name Server --parameter $(srcdir)/test-json-01.json >> $@ @echo diff $(srcdir)/test-json-01.json test-json-01.output.json \> /dev/null >> $@ @chmod +x $@ @@ -281,7 +281,7 @@ test-json-instruction: test-json-client test-json-server test-json-instruction-c @echo export UBUNTU_MENUPROXY="" >> $@ @echo export G_DEBUG=fatal_criticals >> $@ @echo $(XVFB_RUN) >> $@ - @echo $(DBUS_RUNNER) --task $(builddir)/test-json-client --wait-for org.dbusmenu.test --task-name Client --parameter $(top_builddir)/tools/dbusmenu-dumper --parameter /dev/null --ignore-return --task libtool --parameter --mode=execute --parameter $(srcdir)/test-json-instruction-count --parameter $(builddir)/test-json-server --task-name Server --parameter $(srcdir)/test-json-01.json --ignore-return >> $@ + @echo $(DBUS_RUNNER) --task $(builddir)/test-json-client --wait-for org.dbusmenu.test --task-name Client --parameter $(top_builddir)/tools/dbusmenu-dumper --parameter /dev/null --task libtool --parameter --mode=execute --parameter $(srcdir)/test-json-instruction-count --parameter $(builddir)/test-json-server --task-name Server --parameter $(srcdir)/test-json-01.json >> $@ @chmod +x $@ EXTRA_DIST += \ -- cgit v1.2.3 From 61ea13c1c60838570de64b026172dcf13d56ccb0 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Wed, 19 Sep 2012 19:06:22 -0500 Subject: Undo r423, I found this bug while preparing the dbusmenu release but forgot to revert the version before pushing this branch. --- NEWS | 8 -------- configure.ac | 4 ++-- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/NEWS b/NEWS index 95fef36..e69de29 100644 --- a/NEWS +++ b/NEWS @@ -1,8 +0,0 @@ -12.10.0 - - Honor changes to GtkSettings' gtk-menu-images value (lp: #927236) - - don't display an underscore on menuitimes containing a '&' (lp: #994564) - - set the widget for the accelerator even if there isn't a mnemonic (lp: #982656) - - make the vala bindings use pkg-config names, rather than gir ones - - Some platforms don't have valgrind, so treat those unit tests separately - - make headers match independent of the build directory - - constify some public API calls diff --git a/configure.ac b/configure.ac index e0c61bd..608e80d 100644 --- a/configure.ac +++ b/configure.ac @@ -1,11 +1,11 @@ -AC_INIT(libdbusmenu, 12.10.0, ted@canonical.com) +AC_INIT(libdbusmenu, 0.6.1, ted@canonical.com) AC_COPYRIGHT([Copyright 2009,2010 Canonical]) AC_PREREQ(2.62) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(libdbusmenu, 12.10.0, [-Wno-portability]) +AM_INIT_AUTOMAKE(libdbusmenu, 0.6.1, [-Wno-portability]) AM_MAINTAINER_MODE -- cgit v1.2.3 From ddaa8926d360ed0b6714aab4c06f4b91580bddbc Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 20 Sep 2012 11:12:00 -0500 Subject: 12.10.0 --- NEWS | 8 ++++++++ configure.ac | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index e69de29..d6ecc08 100644 --- a/NEWS +++ b/NEWS @@ -0,0 +1,8 @@ +12.10.0 + - Honor changes to GtkSettings' gtk-menu-images value (LP: #927236) + - don't display an underscore on menuitimes containing a '&' (LP: #994564) + - set the widget for the accelerator even if there isn't a mnemonic (LP: #982656) + - make the vala bindings use pkg-config names, rather than gir ones + - Some platforms don't have valgrind, so treat those unit tests separately + - make headers match independent of the build directory + - constify some public API calls diff --git a/configure.ac b/configure.ac index 608e80d..e0c61bd 100644 --- a/configure.ac +++ b/configure.ac @@ -1,11 +1,11 @@ -AC_INIT(libdbusmenu, 0.6.1, ted@canonical.com) +AC_INIT(libdbusmenu, 12.10.0, ted@canonical.com) AC_COPYRIGHT([Copyright 2009,2010 Canonical]) AC_PREREQ(2.62) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(libdbusmenu, 0.6.1, [-Wno-portability]) +AM_INIT_AUTOMAKE(libdbusmenu, 12.10.0, [-Wno-portability]) AM_MAINTAINER_MODE -- cgit v1.2.3