Merge lp:~themuso/libdbusmenu/add-accessible-desc-property into lp:libdbusmenu/0.6

Proposed by Luke Yelavich
Status: Merged
Approved by: Ted Gould
Approved revision: 348
Merged at revision: 358
Proposed branch: lp:~themuso/libdbusmenu/add-accessible-desc-property
Merge into: lp:libdbusmenu/0.6
Diff against target: 106 lines (+23/-1)
5 files modified
configure.ac (+2/-0)
libdbusmenu-glib/client.c (+2/-1)
libdbusmenu-glib/defaults.c (+1/-0)
libdbusmenu-glib/menuitem.h (+12/-0)
libdbusmenu-gtk/client.c (+6/-0)
To merge this branch: bzr merge lp:~themuso/libdbusmenu/add-accessible-desc-property
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
DBus Menu Team Pending
Review via email: mp+85414@code.launchpad.net

Description of the change

THe code in this branch builds and does work at a technical level, but the desired alternative labels for menu items won't be properly read with orca unless either GTK3 version 3.2.2-2ubuntu4 or GTK2 version 2.24.8-0ubuntu5 are installed, as I had to extend the accessible objects in GTK to allow dbusmenu to set a different accessible name.

I hope to get the GTK code changes upstream ASAP, hopefully for GTK 3.4, but if not, then future GTK releases.

To post a comment you must log in.
Revision history for this message
Luke Yelavich (themuso) wrote :

Ok, turns out that this does not need any changes in GTK, GTK supports this natively.

Revision history for this message
Ted Gould (ted) wrote :

There were a couple of typos in the function names. But I've cleaned them up. No worries.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'configure.ac'
--- configure.ac 2011-10-13 16:12:03 +0000
+++ configure.ac 2011-12-13 00:11:23 +0000
@@ -73,6 +73,7 @@
73AS_IF([test "x$enable_gtk" != "xno"],[73AS_IF([test "x$enable_gtk" != "xno"],[
74AS_IF([test "x$with_gtk" = x3],74AS_IF([test "x$with_gtk" = x3],
75 [PKG_CHECK_MODULES(DBUSMENUGTK, gtk+-3.0 >= $GTK3_REQUIRED_VERSION75 [PKG_CHECK_MODULES(DBUSMENUGTK, gtk+-3.0 >= $GTK3_REQUIRED_VERSION
76 atk
76 glib-2.0 >= $GLIB_REQUIRED_VERSION,77 glib-2.0 >= $GLIB_REQUIRED_VERSION,
77 [have_gtk=yes]78 [have_gtk=yes]
78)79)
@@ -80,6 +81,7 @@
80 ],81 ],
81 [test "x$with_gtk" = x2],82 [test "x$with_gtk" = x2],
82 [PKG_CHECK_MODULES(DBUSMENUGTK, gtk+-2.0 >= $GTK_REQUIRED_VERSION83 [PKG_CHECK_MODULES(DBUSMENUGTK, gtk+-2.0 >= $GTK_REQUIRED_VERSION
84 atk
83 glib-2.0 >= $GLIB_REQUIRED_VERSION,85 glib-2.0 >= $GLIB_REQUIRED_VERSION,
84 [have_gtk=yes]86 [have_gtk=yes]
85)87)
8688
=== modified file 'libdbusmenu-glib/client.c'
--- libdbusmenu-glib/client.c 2011-09-30 14:21:15 +0000
+++ libdbusmenu-glib/client.c 2011-12-13 00:11:23 +0000
@@ -331,7 +331,7 @@
331 return;331 return;
332}332}
333333
334#define LAYOUT_PROPS_COUNT 5334#define LAYOUT_PROPS_COUNT 6
335335
336static void336static void
337dbusmenu_client_init (DbusmenuClient *self)337dbusmenu_client_init (DbusmenuClient *self)
@@ -359,6 +359,7 @@
359 layout_props[2] = DBUSMENU_MENUITEM_PROP_VISIBLE;359 layout_props[2] = DBUSMENU_MENUITEM_PROP_VISIBLE;
360 layout_props[3] = DBUSMENU_MENUITEM_PROP_ENABLED;360 layout_props[3] = DBUSMENU_MENUITEM_PROP_ENABLED;
361 layout_props[4] = DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY;361 layout_props[4] = DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY;
362 layout_props[5] = DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC;
362 layout_props[LAYOUT_PROPS_COUNT] = NULL;363 layout_props[LAYOUT_PROPS_COUNT] = NULL;
363 priv->layout_props = g_variant_new_strv((const gchar * const *)layout_props, LAYOUT_PROPS_COUNT);364 priv->layout_props = g_variant_new_strv((const gchar * const *)layout_props, LAYOUT_PROPS_COUNT);
364 g_variant_ref_sink(priv->layout_props);365 g_variant_ref_sink(priv->layout_props);
365366
=== modified file 'libdbusmenu-glib/defaults.c'
--- libdbusmenu-glib/defaults.c 2011-08-22 16:30:06 +0000
+++ libdbusmenu-glib/defaults.c 2011-12-13 00:11:23 +0000
@@ -88,6 +88,7 @@
88 dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_SHORTCUT, G_VARIANT_TYPE("aas"), NULL); 88 dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_SHORTCUT, G_VARIANT_TYPE("aas"), NULL);
89 dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY, G_VARIANT_TYPE_STRING, NULL); 89 dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY, G_VARIANT_TYPE_STRING, NULL);
90 dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_DISPOSITION, G_VARIANT_TYPE_STRING, g_variant_new_string(DBUSMENU_MENUITEM_DISPOSITION_NORMAL)); 90 dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_DISPOSITION, G_VARIANT_TYPE_STRING, g_variant_new_string(DBUSMENU_MENUITEM_DISPOSITION_NORMAL));
91 dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC,G_VARIANT_TYPE_STRING, NULL);
9192
92 /* Separator defaults */93 /* Separator defaults */
93 dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_SEPARATOR, DBUSMENU_MENUITEM_PROP_VISIBLE, G_VARIANT_TYPE_BOOLEAN, g_variant_new_boolean(TRUE)); 94 dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_SEPARATOR, DBUSMENU_MENUITEM_PROP_VISIBLE, G_VARIANT_TYPE_BOOLEAN, g_variant_new_boolean(TRUE));
9495
=== modified file 'libdbusmenu-glib/menuitem.h'
--- libdbusmenu-glib/menuitem.h 2011-08-22 16:39:13 +0000
+++ libdbusmenu-glib/menuitem.h 2011-12-13 00:11:23 +0000
@@ -154,6 +154,18 @@
154 */154 */
155#define DBUSMENU_MENUITEM_PROP_ICON_DATA "icon-data"155#define DBUSMENU_MENUITEM_PROP_ICON_DATA "icon-data"
156/**156/**
157 * DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC:
158 *
159 * #DbusmenuMenuitem property used to provide a textual description of any
160 * information that the icon may convey. The contents of this property are
161 * passed through to assistive technologies such as the Orca screen reader.
162 * The contents of this property will not be visible in the menu item. If
163 * this property is set, Orca will use this property instead of the label
164 * property.
165 * Type: #G_VARIANT_TYPE_STRING
166 */
167#define DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC "accessible-desc"
168/**
157 * DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE:169 * DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE:
158 *170 *
159 * #DbusmenuMenuitem property that says what type of toggle entry should171 * #DbusmenuMenuitem property that says what type of toggle entry should
160172
=== modified file 'libdbusmenu-gtk/client.c'
--- libdbusmenu-gtk/client.c 2011-11-10 22:49:27 +0000
+++ libdbusmenu-gtk/client.c 2011-12-13 00:11:23 +0000
@@ -32,6 +32,7 @@
3232
33#include <gtk/gtk.h>33#include <gtk/gtk.h>
34#include <glib.h>34#include <glib.h>
35#include <atk/atk.h>
3536
36#include "client.h"37#include "client.h"
37#include "menuitem.h"38#include "menuitem.h"
@@ -745,6 +746,9 @@
745 process_submenu(mi, gmi, variant, gtkclient);746 process_submenu(mi, gmi, variant, gtkclient);
746 } else if (!g_strcmp0(prop, DBUSMENU_MENUITEM_PROP_DISPOSITION)) {747 } else if (!g_strcmp0(prop, DBUSMENU_MENUITEM_PROP_DISPOSITION)) {
747 process_disposition(mi, gmi, variant, gtkclient);748 process_disposition(mi, gmi, variant, gtkclient);
749 } else if (!g_strcmp0(prop, DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC)) {
750 atk_object_set_name(gtk_widget_get_accessible(GTK_WIDGET(gmi)), variant == NULL ? NULL :
751 g_variant_get_string(variant, NULL));
748 }752 }
749753
750 return;754 return;
@@ -890,6 +894,8 @@
890 process_toggle_state(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_TOGGLE_STATE));894 process_toggle_state(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_TOGGLE_STATE));
891 process_submenu(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY), client);895 process_submenu(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY), client);
892 process_disposition(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_DISPOSITION), client);896 process_disposition(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_DISPOSITION), client);
897 atk_object_set_name(gtk_widget_Get_accessible(GTK_WIDGET)gmi)),
898 g_variant_get_string(dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC)));
893 refresh_shortcut(client, item);899 refresh_shortcut(client, item);
894900
895 /* Oh, we're a child, let's deal with that */901 /* Oh, we're a child, let's deal with that */

Subscribers

People subscribed via source and target branches

to all changes: