diff options
author | Ted Gould <ted@gould.cx> | 2012-01-30 23:25:37 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2012-01-30 23:25:37 -0600 |
commit | d4a56efd670ae2432da8be9932df365c75ea0d72 (patch) | |
tree | 0f489d0586d6c5701c663893e64d01190819e23e /libdbusmenu-gtk/client.c | |
parent | 8b1876780ab91339e24d51f72f6b8f9c4a5abfed (diff) | |
parent | 9332359a3cad3a5f23e7ff0c4bae14159818d026 (diff) | |
download | libdbusmenu-d4a56efd670ae2432da8be9932df365c75ea0d72.tar.gz libdbusmenu-d4a56efd670ae2432da8be9932df365c75ea0d72.tar.bz2 libdbusmenu-d4a56efd670ae2432da8be9932df365c75ea0d72.zip |
* New upstream release.
* Add property for accessible descriptions
* Use insert/remove signals on GTK3 build
* Change icon data to be a byte stream instead of base64
* Adjust GTK3 include path to match other libs
* Don't get objects from boolean values (LP: #870742)
* Fix depreactions on GTK3 (LP: #917115)
Diffstat (limited to 'libdbusmenu-gtk/client.c')
-rw-r--r-- | libdbusmenu-gtk/client.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c index 38b6a75..9888cbe 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 <gtk/gtk.h> #include <glib.h> +#include <atk/atk.h> #include "client.h" #include "menuitem.h" @@ -505,7 +506,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; @@ -575,6 +575,14 @@ close_in_idle (DbusmenuMenuitem * mi) } 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) { if (gtk_widget_get_visible (menu)) { @@ -591,8 +599,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); } } } @@ -738,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; @@ -885,6 +896,11 @@ dbusmenu_gtkclient_newitem_base (DbusmenuGtkClient * client, DbusmenuMenuitem * process_disposition(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_DISPOSITION), client); 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)); |