From 1b83b3b0758d29d94a1e404f551939ea1885ad76 Mon Sep 17 00:00:00 2001 From: Michael Terry Date: Thu, 10 Nov 2011 17:49:27 -0500 Subject: make sure to cancel an idle callback when the object dies --- libdbusmenu-gtk/client.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'libdbusmenu-gtk') diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c index 38b6a75..533764a 100644 --- a/libdbusmenu-gtk/client.c +++ b/libdbusmenu-gtk/client.c @@ -505,7 +505,6 @@ menu_item_stop_activating(DbusmenuMenuitem * mi) guint id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(parent), data_idle_close_id)); if (id > 0) { - g_source_remove(id); g_object_set_data(G_OBJECT(parent), data_idle_close_id, GINT_TO_POINTER(0)); should_close = TRUE; @@ -574,6 +573,14 @@ close_in_idle (DbusmenuMenuitem * mi) return FALSE; } +static void +cancel_idle_close_id (gpointer data) +{ + guint id = GPOINTER_TO_INT(data); + if (id > 0) + g_source_remove(id); +} + static void submenu_notify_visible_cb (GtkWidget * menu, GParamSpec * pspec, DbusmenuMenuitem * mi) { @@ -591,8 +598,8 @@ submenu_notify_visible_cb (GtkWidget * menu, GParamSpec * pspec, DbusmenuMenuite data_idle_close_id)); if (id == 0) { id = g_idle_add((GSourceFunc)close_in_idle, mi); - g_object_set_data(G_OBJECT(mi), data_idle_close_id, - GINT_TO_POINTER(id)); + g_object_set_data_full(G_OBJECT(mi), data_idle_close_id, + GINT_TO_POINTER(id), cancel_idle_close_id); } } } -- cgit v1.2.3 From 0f7fdf8d2c567a641083646a43e6ebec1faf9078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gy=C3=B6rgy=20Ball=C3=B3?= Date: Mon, 21 Nov 2011 03:52:39 +0100 Subject: Use different directory for headers of gtk3 library --- libdbusmenu-gtk/Makefile.am | 2 +- libdbusmenu-gtk/dbusmenu-gtk3-0.4.pc.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'libdbusmenu-gtk') diff --git a/libdbusmenu-gtk/Makefile.am b/libdbusmenu-gtk/Makefile.am index b4564d1..7860433 100644 --- a/libdbusmenu-gtk/Makefile.am +++ b/libdbusmenu-gtk/Makefile.am @@ -33,7 +33,7 @@ glib_enum_headers = $(srcdir)/genericmenuitem.h # Include Directory ##################### -libdbusmenu_gtkincludedir=$(includedir)/libdbusmenu-0.4/libdbusmenu-gtk$(VER)/ +libdbusmenu_gtkincludedir=$(includedir)/libdbusmenu$(VER)-0.4/libdbusmenu-gtk/ libdbusmenu_gtkinclude_HEADERS = \ dbusmenu-gtk.h \ diff --git a/libdbusmenu-gtk/dbusmenu-gtk3-0.4.pc.in b/libdbusmenu-gtk/dbusmenu-gtk3-0.4.pc.in index c297db3..c320a57 100644 --- a/libdbusmenu-gtk/dbusmenu-gtk3-0.4.pc.in +++ b/libdbusmenu-gtk/dbusmenu-gtk3-0.4.pc.in @@ -4,7 +4,7 @@ libdir=@libdir@ bindir=@bindir@ includedir=@includedir@ -Cflags: -I${includedir}/libdbusmenu-0.4 +Cflags: -I${includedir}/libdbusmenu3-0.4 Requires: dbusmenu-glib-0.4 gdk-pixbuf-2.0 gtk+-3.0 Libs: -L${libdir} -ldbusmenu-gtk3 -- cgit v1.2.3 From 144708e6667818d48e3bbd9403e447079e8a5c56 Mon Sep 17 00:00:00 2001 From: Luke Yelavich Date: Tue, 13 Dec 2011 10:56:56 +1100 Subject: Add a new property DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC, to set an alternative label for a menu item. This alternative label is only used for assistive technologies such as Orca. It is particularly useful for menu items where an icon is used to present further information to the user, in which case this property can be used to give a textual description of the icon. --- libdbusmenu-gtk/client.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libdbusmenu-gtk') diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c index 533764a..7390fb1 100644 --- a/libdbusmenu-gtk/client.c +++ b/libdbusmenu-gtk/client.c @@ -32,6 +32,7 @@ License version 3 and version 2.1 along with this program. If not, see #include #include +#include #include "client.h" #include "menuitem.h" @@ -745,6 +746,9 @@ menu_prop_change_cb (DbusmenuMenuitem * mi, gchar * prop, GVariant * variant, Db process_submenu(mi, gmi, variant, gtkclient); } else if (!g_strcmp0(prop, DBUSMENU_MENUITEM_PROP_DISPOSITION)) { process_disposition(mi, gmi, variant, gtkclient); + } else if (!g_strcmp0(prop, DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC)) { + atk_object_set_name(gtk_widget_get_accessible(GTK_WIDGET(gmi)), variant == NULL ? NULL : + g_variant_get_string(variant, NULL)); } return; @@ -890,6 +894,8 @@ dbusmenu_gtkclient_newitem_base (DbusmenuGtkClient * client, DbusmenuMenuitem * process_toggle_state(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_TOGGLE_STATE)); process_submenu(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY), client); process_disposition(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_DISPOSITION), client); + atk_object_set_name(gtk_widget_Get_accessible(GTK_WIDGET)gmi)), + g_variant_get_string(dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC))); refresh_shortcut(client, item); /* Oh, we're a child, let's deal with that */ -- cgit v1.2.3 From 82f99f0a30316807d0c261308bc207e74eacbd33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gy=C3=B6rgy=20Ball=C3=B3?= Date: Thu, 5 Jan 2012 20:39:42 +0100 Subject: Separate libdbusmenu-glib and libdbusmenu-gtk include directories --- libdbusmenu-gtk/Makefile.am | 2 +- libdbusmenu-gtk/dbusmenu-gtk-0.4.pc.in | 2 +- libdbusmenu-gtk/dbusmenu-gtk3-0.4.pc.in | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'libdbusmenu-gtk') diff --git a/libdbusmenu-gtk/Makefile.am b/libdbusmenu-gtk/Makefile.am index 7860433..2b3075f 100644 --- a/libdbusmenu-gtk/Makefile.am +++ b/libdbusmenu-gtk/Makefile.am @@ -33,7 +33,7 @@ glib_enum_headers = $(srcdir)/genericmenuitem.h # Include Directory ##################### -libdbusmenu_gtkincludedir=$(includedir)/libdbusmenu$(VER)-0.4/libdbusmenu-gtk/ +libdbusmenu_gtkincludedir=$(includedir)/libdbusmenu-gtk$(VER)-0.4/libdbusmenu-gtk/ libdbusmenu_gtkinclude_HEADERS = \ dbusmenu-gtk.h \ diff --git a/libdbusmenu-gtk/dbusmenu-gtk-0.4.pc.in b/libdbusmenu-gtk/dbusmenu-gtk-0.4.pc.in index 9a1b460..cae4c10 100644 --- a/libdbusmenu-gtk/dbusmenu-gtk-0.4.pc.in +++ b/libdbusmenu-gtk/dbusmenu-gtk-0.4.pc.in @@ -4,7 +4,7 @@ libdir=@libdir@ bindir=@bindir@ includedir=@includedir@ -Cflags: -I${includedir}/libdbusmenu-0.4 +Cflags: -I${includedir}/libdbusmenu-gtk-0.4 Requires: dbusmenu-glib-0.4 gdk-pixbuf-2.0 gtk+-2.0 Libs: -L${libdir} -ldbusmenu-gtk diff --git a/libdbusmenu-gtk/dbusmenu-gtk3-0.4.pc.in b/libdbusmenu-gtk/dbusmenu-gtk3-0.4.pc.in index c320a57..ba4c1aa 100644 --- a/libdbusmenu-gtk/dbusmenu-gtk3-0.4.pc.in +++ b/libdbusmenu-gtk/dbusmenu-gtk3-0.4.pc.in @@ -4,7 +4,7 @@ libdir=@libdir@ bindir=@bindir@ includedir=@includedir@ -Cflags: -I${includedir}/libdbusmenu3-0.4 +Cflags: -I${includedir}/libdbusmenu-gtk3-0.4 Requires: dbusmenu-glib-0.4 gdk-pixbuf-2.0 gtk+-3.0 Libs: -L${libdir} -ldbusmenu-gtk3 -- cgit v1.2.3 From 248e0c0f0ce3883579caa56369e7e92340ae9c64 Mon Sep 17 00:00:00 2001 From: Ryan Lortie Date: Thu, 12 Jan 2012 11:35:50 +0100 Subject: in gtk3, use stock signals instead of Ubuntu-specific ones --- libdbusmenu-gtk/Makefile.am | 2 +- libdbusmenu-gtk/parser.c | 35 +++++++++++++++++++++++------------ 2 files changed, 24 insertions(+), 13 deletions(-) (limited to 'libdbusmenu-gtk') diff --git a/libdbusmenu-gtk/Makefile.am b/libdbusmenu-gtk/Makefile.am index b4564d1..9e0967f 100644 --- a/libdbusmenu-gtk/Makefile.am +++ b/libdbusmenu-gtk/Makefile.am @@ -76,7 +76,7 @@ libdbusmenu_gtk3includedir = $(libdbusmenu_gtkincludedir) libdbusmenu_gtk3include_HEADERS = $(libdbusmenu_gtkinclude_HEADERS) libdbusmenu_gtk3_la_SOURCES = $(libdbusmenu_gtk_la_SOURCES) libdbusmenu_gtk3_la_LDFLAGS = $(libdbusmenu_gtk_la_LDFLAGS) -libdbusmenu_gtk3_la_CFLAGS = $(libdbusmenu_gtk_la_CFLAGS) +libdbusmenu_gtk3_la_CFLAGS = $(libdbusmenu_gtk_la_CFLAGS) -DWITH_GTK3 libdbusmenu_gtk3_la_LIBADD = $(libdbusmenu_gtk_la_LIBADD) pkgconfig_DATA = dbusmenu-gtk$(VER)-0.4.pc diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c index 92932c5..5f50dc6 100644 --- a/libdbusmenu-gtk/parser.c +++ b/libdbusmenu-gtk/parser.c @@ -66,10 +66,13 @@ static void image_notify_cb (GtkWidget * widget, static void action_notify_cb (GtkAction * action, GParamSpec * pspec, gpointer data); -static void child_added_cb (GtkContainer * menu, +static void item_inserted_cb (GtkContainer * menu, GtkWidget * widget, +#ifdef WITH_GTK3 + gint position, +#endif gpointer data); -static void child_removed_cb (GtkContainer * menu, +static void item_removed_cb (GtkContainer * menu, GtkWidget * widget, gpointer data); static void theme_changed_cb (GtkIconTheme * theme, @@ -184,9 +187,9 @@ parse_data_free (gpointer data) if (pdata != NULL && pdata->shell != NULL) { g_signal_handlers_disconnect_matched(pdata->shell, (GSignalMatchType)G_SIGNAL_MATCH_FUNC, - 0, 0, NULL, G_CALLBACK(child_added_cb), NULL); + 0, 0, NULL, G_CALLBACK(item_inserted_cb), NULL); g_signal_handlers_disconnect_matched(pdata->shell, (GSignalMatchType)G_SIGNAL_MATCH_FUNC, - 0, 0, NULL, G_CALLBACK(child_removed_cb), NULL); + 0, 0, NULL, G_CALLBACK(item_removed_cb), NULL); g_object_remove_weak_pointer(G_OBJECT(pdata->shell), (gpointer*)&pdata->shell); } @@ -290,12 +293,16 @@ watch_submenu(DbusmenuMenuitem * mi, GtkWidget * menu) pdata->shell = menu; g_signal_connect (G_OBJECT (menu), - "child-added", - G_CALLBACK (child_added_cb), +#ifdef WITH_GTK3 + "insert", +#else + "child-added" +#endif + G_CALLBACK (item_inserted_cb), mi); g_signal_connect (G_OBJECT (menu), - "child-removed", - G_CALLBACK (child_removed_cb), + "remove", + G_CALLBACK (item_removed_cb), mi); g_object_add_weak_pointer(G_OBJECT (menu), (gpointer*)&pdata->shell); @@ -1137,7 +1144,12 @@ widget_add_cb (GtkWidget *widget, /* A child item was added to a menu we're watching. Let's try to integrate it. */ static void -child_added_cb (GtkContainer *menu, GtkWidget *widget, gpointer data) +item_inserted_cb (GtkContainer *menu, + GtkWidget *widget, +#ifdef WITH_GTK3 + gint position, +#endif + gpointer data) { DbusmenuMenuitem *menuitem = (DbusmenuMenuitem *)data; @@ -1152,9 +1164,9 @@ child_added_cb (GtkContainer *menu, GtkWidget *widget, gpointer data) parse_menu_structure_helper(widget, &recurse); } -/* A child item was added to a menu we're watching. Let's try to integrate it. */ +/* A child item was removed from a menu we're watching. */ static void -child_removed_cb (GtkContainer *menu, GtkWidget *widget, gpointer data) +item_removed_cb (GtkContainer *menu, GtkWidget *widget, gpointer data) { gpointer pmi = g_object_get_data(G_OBJECT(widget), CACHED_MENUITEM); if (pmi == NULL) { @@ -1216,4 +1228,3 @@ should_show_image (GtkImage *image) return FALSE; } - -- cgit v1.2.3 From 145fba945cdc582ccdf5dc483acb7f170325549b Mon Sep 17 00:00:00 2001 From: Mikkel Kamstrup Erlandsen Date: Mon, 16 Jan 2012 12:57:11 +0100 Subject: Fix build with gtk3 by ifdeffing the GtkBox/HBox construction in genericmenuitem.c --- libdbusmenu-gtk/genericmenuitem.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libdbusmenu-gtk') diff --git a/libdbusmenu-gtk/genericmenuitem.c b/libdbusmenu-gtk/genericmenuitem.c index ef77a2e..098de67 100644 --- a/libdbusmenu-gtk/genericmenuitem.c +++ b/libdbusmenu-gtk/genericmenuitem.c @@ -241,7 +241,12 @@ set_label (GtkMenuItem * menu_item, const gchar * in_label) /* We need to put the child into a new box and make the box the child of the menu item. Basically we're inserting a box in the middle. */ + #ifdef HAVE_GTK3 + GtkWidget * hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, + get_toggle_space(GTK_WIDGET(menu_item))); + #else GtkWidget * hbox = gtk_hbox_new(FALSE, get_toggle_space(GTK_WIDGET(menu_item))); + #endif g_object_ref(child); gtk_container_remove(GTK_CONTAINER(menu_item), child); gtk_box_pack_start(GTK_BOX(hbox), child, FALSE, FALSE, 0); @@ -457,7 +462,12 @@ genericmenuitem_set_image (Genericmenuitem * menu_item, GtkWidget * image) /* We need to put the child into a new box and make the box the child of the menu item. Basically we're inserting a box in the middle. */ + #ifdef HAVE_GTK3 + GtkWidget * hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, + get_toggle_space(GTK_WIDGET(menu_item))); + #else GtkWidget * hbox = gtk_hbox_new(FALSE, get_toggle_space(GTK_WIDGET(menu_item))); + #endif g_object_ref(child); gtk_container_remove(GTK_CONTAINER(menu_item), child); gtk_box_pack_end(GTK_BOX(hbox), child, TRUE, TRUE, 0); -- cgit v1.2.3 From 9a01ce5b74bd5d2012a59e9d55a49531da1c4d14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20G=C3=A2teau?= Date: Mon, 23 Jan 2012 14:38:36 +0100 Subject: Change icon-data to contains raw png bytes, without base64 encoding Reasons: - base64 encoding is not necessary because dbusmenu properties can use any dbus-supported types. - faster: no need to base64 decode/encode images - more efficient: base64-encoded data is 1/3 bigger than raw data --- libdbusmenu-gtk/menuitem.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'libdbusmenu-gtk') diff --git a/libdbusmenu-gtk/menuitem.c b/libdbusmenu-gtk/menuitem.c index 0f511bc..19ea1a0 100644 --- a/libdbusmenu-gtk/menuitem.c +++ b/libdbusmenu-gtk/menuitem.c @@ -66,11 +66,9 @@ dbusmenu_menuitem_property_set_image (DbusmenuMenuitem * menuitem, const gchar * return FALSE; } - gchar * prop_str = g_base64_encode((guchar *)png_data, png_data_len); gboolean propreturn = FALSE; - propreturn = dbusmenu_menuitem_property_set(menuitem, property, prop_str); + propreturn = dbusmenu_menuitem_property_set_byte_array(menuitem, property, (guchar *)png_data, png_data_len); - g_free(prop_str); g_free(png_data); return propreturn; @@ -94,20 +92,17 @@ dbusmenu_menuitem_property_get_image (DbusmenuMenuitem * menuitem, const gchar * g_return_val_if_fail(DBUSMENU_IS_MENUITEM(menuitem), NULL); g_return_val_if_fail(property != NULL && property[0] != '\0', NULL); - const gchar * value = dbusmenu_menuitem_property_get(menuitem, property); + gsize length = 0; + const guchar * icondata = dbusmenu_menuitem_property_get_byte_array(menuitem, property, &length); /* There is no icon */ - if (value == NULL || value[0] == '\0') { + if (length == 0) { return NULL; } - - gsize length = 0; - guchar * icondata = g_base64_decode(value, &length); GInputStream * input = g_memory_input_stream_new_from_data(icondata, length, NULL); if (input == NULL) { g_warning("Cound not create input stream from icon property data"); - g_free(icondata); return NULL; } @@ -120,7 +115,6 @@ dbusmenu_menuitem_property_get_image (DbusmenuMenuitem * menuitem, const gchar * } g_object_unref(input); - g_free(icondata); return icon; } -- cgit v1.2.3 From d0065933d25307a95644e3ab984de0f4f848d6ad Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 26 Jan 2012 13:33:24 -0600 Subject: Remove custom WITH_GTK3 and use the HAVE_GTK3 --- libdbusmenu-gtk/Makefile.am | 2 +- libdbusmenu-gtk/parser.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'libdbusmenu-gtk') diff --git a/libdbusmenu-gtk/Makefile.am b/libdbusmenu-gtk/Makefile.am index 9e0967f..b4564d1 100644 --- a/libdbusmenu-gtk/Makefile.am +++ b/libdbusmenu-gtk/Makefile.am @@ -76,7 +76,7 @@ libdbusmenu_gtk3includedir = $(libdbusmenu_gtkincludedir) libdbusmenu_gtk3include_HEADERS = $(libdbusmenu_gtkinclude_HEADERS) libdbusmenu_gtk3_la_SOURCES = $(libdbusmenu_gtk_la_SOURCES) libdbusmenu_gtk3_la_LDFLAGS = $(libdbusmenu_gtk_la_LDFLAGS) -libdbusmenu_gtk3_la_CFLAGS = $(libdbusmenu_gtk_la_CFLAGS) -DWITH_GTK3 +libdbusmenu_gtk3_la_CFLAGS = $(libdbusmenu_gtk_la_CFLAGS) libdbusmenu_gtk3_la_LIBADD = $(libdbusmenu_gtk_la_LIBADD) pkgconfig_DATA = dbusmenu-gtk$(VER)-0.4.pc diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c index 5f50dc6..d222f10 100644 --- a/libdbusmenu-gtk/parser.c +++ b/libdbusmenu-gtk/parser.c @@ -68,7 +68,7 @@ static void action_notify_cb (GtkAction * action, gpointer data); static void item_inserted_cb (GtkContainer * menu, GtkWidget * widget, -#ifdef WITH_GTK3 +#ifdef HAVE_GTK3 gint position, #endif gpointer data); @@ -293,7 +293,7 @@ watch_submenu(DbusmenuMenuitem * mi, GtkWidget * menu) pdata->shell = menu; g_signal_connect (G_OBJECT (menu), -#ifdef WITH_GTK3 +#ifdef HAVE_GTK3 "insert", #else "child-added" @@ -1146,7 +1146,7 @@ widget_add_cb (GtkWidget *widget, static void item_inserted_cb (GtkContainer *menu, GtkWidget *widget, -#ifdef WITH_GTK3 +#ifdef HAVE_GTK3 gint position, #endif gpointer data) -- cgit v1.2.3 From 4eae3efbe5c3aa84035b2ade9ceedd68b7b3e895 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 26 Jan 2012 13:36:57 -0600 Subject: Move the no-error on deprications into the Makefiles so it's always after the -Wall --- libdbusmenu-gtk/Makefile.am | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libdbusmenu-gtk') diff --git a/libdbusmenu-gtk/Makefile.am b/libdbusmenu-gtk/Makefile.am index b4564d1..9f297f5 100644 --- a/libdbusmenu-gtk/Makefile.am +++ b/libdbusmenu-gtk/Makefile.am @@ -62,7 +62,10 @@ libdbusmenu_gtk_la_LDFLAGS = \ -export-symbols-regex "^[^_].*" libdbusmenu_gtk_la_CFLAGS = \ - $(DBUSMENUGTK_CFLAGS) -I$(top_srcdir) -Wall -Werror -DG_DISABLE_DEPRECATED -DG_LOG_DOMAIN="\"LIBDBUSMENU-GTK\"" + $(DBUSMENUGTK_CFLAGS) \ + -I$(top_srcdir) \ + -Wall -Werror -Wno-error=deprecated-declarations \ + -DG_LOG_DOMAIN="\"LIBDBUSMENU-GTK\"" libdbusmenu_gtk_la_LIBADD = \ ../libdbusmenu-glib/libdbusmenu-glib.la \ -- cgit v1.2.3 From 9b2524f59c26df873495b308b2ea7ca2fda602f6 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 26 Jan 2012 13:52:38 -0600 Subject: Fix function calls here --- libdbusmenu-gtk/client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libdbusmenu-gtk') diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c index 7390fb1..14c71ab 100644 --- a/libdbusmenu-gtk/client.c +++ b/libdbusmenu-gtk/client.c @@ -894,8 +894,8 @@ dbusmenu_gtkclient_newitem_base (DbusmenuGtkClient * client, DbusmenuMenuitem * process_toggle_state(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_TOGGLE_STATE)); process_submenu(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY), client); process_disposition(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_DISPOSITION), client); - atk_object_set_name(gtk_widget_Get_accessible(GTK_WIDGET)gmi)), - g_variant_get_string(dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC))); + atk_object_set_name(gtk_widget_get_accessible(GTK_WIDGET(gmi)), + g_variant_get_string(dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC), NULL)); refresh_shortcut(client, item); /* Oh, we're a child, let's deal with that */ -- cgit v1.2.3 From b68c281a6b3761af902a4d4e8a35cf450c298ec0 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 26 Jan 2012 13:53:21 -0600 Subject: Missing comma --- libdbusmenu-gtk/parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libdbusmenu-gtk') diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c index d222f10..2abeccd 100644 --- a/libdbusmenu-gtk/parser.c +++ b/libdbusmenu-gtk/parser.c @@ -296,7 +296,7 @@ watch_submenu(DbusmenuMenuitem * mi, GtkWidget * menu) #ifdef HAVE_GTK3 "insert", #else - "child-added" + "child-added", #endif G_CALLBACK (item_inserted_cb), mi); -- cgit v1.2.3 From a68451b70e621c1c9b59f4d6be78c3e327356eed Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 26 Jan 2012 13:56:13 -0600 Subject: Include config.h to get the HAVE_GTK3 define --- libdbusmenu-gtk/parser.c | 1 + 1 file changed, 1 insertion(+) (limited to 'libdbusmenu-gtk') diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c index 2abeccd..0ecfa1e 100644 --- a/libdbusmenu-gtk/parser.c +++ b/libdbusmenu-gtk/parser.c @@ -29,6 +29,7 @@ License version 3 and version 2.1 along with this program. If not, see #include "parser.h" #include "menuitem.h" #include "client.h" +#include "config.h" #define CACHED_MENUITEM "dbusmenu-gtk-parser-cached-item" #define PARSER_DATA "dbusmenu-gtk-parser-data" -- cgit v1.2.3 From d27208df523d669e2bf86ab0506634d0ae86e558 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 26 Jan 2012 19:53:42 -0600 Subject: Only setting the accessible object name if it has been set --- libdbusmenu-gtk/client.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libdbusmenu-gtk') diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c index 14c71ab..9888cbe 100644 --- a/libdbusmenu-gtk/client.c +++ b/libdbusmenu-gtk/client.c @@ -894,10 +894,13 @@ dbusmenu_gtkclient_newitem_base (DbusmenuGtkClient * client, DbusmenuMenuitem * process_toggle_state(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_TOGGLE_STATE)); process_submenu(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY), client); process_disposition(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_DISPOSITION), client); - atk_object_set_name(gtk_widget_get_accessible(GTK_WIDGET(gmi)), - g_variant_get_string(dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC), NULL)); refresh_shortcut(client, item); + const gchar * a11y_desc = dbusmenu_menuitem_property_get(item, DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC); + if (a11y_desc != NULL) { + atk_object_set_name(gtk_widget_get_accessible(GTK_WIDGET(gmi)), a11y_desc); + } + /* Oh, we're a child, let's deal with that */ if (parent != NULL) { new_child(parent, item, dbusmenu_menuitem_get_position(item, parent), DBUSMENU_GTKCLIENT(client)); -- cgit v1.2.3