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

Proposed by Luke Yelavich on 2011-12-13
Status: Merged
Approved by: Ted Gould on 2012-01-26
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) 2012-01-24 Approve on 2012-01-26
DBus Menu Team 2011-12-13 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.
Luke Yelavich (themuso) wrote :

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

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
1=== modified file 'configure.ac'
2--- configure.ac 2011-10-13 16:12:03 +0000
3+++ configure.ac 2011-12-13 00:11:23 +0000
4@@ -73,6 +73,7 @@
5 AS_IF([test "x$enable_gtk" != "xno"],[
6 AS_IF([test "x$with_gtk" = x3],
7 [PKG_CHECK_MODULES(DBUSMENUGTK, gtk+-3.0 >= $GTK3_REQUIRED_VERSION
8+ atk
9 glib-2.0 >= $GLIB_REQUIRED_VERSION,
10 [have_gtk=yes]
11 )
12@@ -80,6 +81,7 @@
13 ],
14 [test "x$with_gtk" = x2],
15 [PKG_CHECK_MODULES(DBUSMENUGTK, gtk+-2.0 >= $GTK_REQUIRED_VERSION
16+ atk
17 glib-2.0 >= $GLIB_REQUIRED_VERSION,
18 [have_gtk=yes]
19 )
20
21=== modified file 'libdbusmenu-glib/client.c'
22--- libdbusmenu-glib/client.c 2011-09-30 14:21:15 +0000
23+++ libdbusmenu-glib/client.c 2011-12-13 00:11:23 +0000
24@@ -331,7 +331,7 @@
25 return;
26 }
27
28-#define LAYOUT_PROPS_COUNT 5
29+#define LAYOUT_PROPS_COUNT 6
30
31 static void
32 dbusmenu_client_init (DbusmenuClient *self)
33@@ -359,6 +359,7 @@
34 layout_props[2] = DBUSMENU_MENUITEM_PROP_VISIBLE;
35 layout_props[3] = DBUSMENU_MENUITEM_PROP_ENABLED;
36 layout_props[4] = DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY;
37+ layout_props[5] = DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC;
38 layout_props[LAYOUT_PROPS_COUNT] = NULL;
39 priv->layout_props = g_variant_new_strv((const gchar * const *)layout_props, LAYOUT_PROPS_COUNT);
40 g_variant_ref_sink(priv->layout_props);
41
42=== modified file 'libdbusmenu-glib/defaults.c'
43--- libdbusmenu-glib/defaults.c 2011-08-22 16:30:06 +0000
44+++ libdbusmenu-glib/defaults.c 2011-12-13 00:11:23 +0000
45@@ -88,6 +88,7 @@
46 dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_SHORTCUT, G_VARIANT_TYPE("aas"), NULL);
47 dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY, G_VARIANT_TYPE_STRING, NULL);
48 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));
49+ dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_DEFAULT, DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC,G_VARIANT_TYPE_STRING, NULL);
50
51 /* Separator defaults */
52 dbusmenu_defaults_default_set(self, DBUSMENU_CLIENT_TYPES_SEPARATOR, DBUSMENU_MENUITEM_PROP_VISIBLE, G_VARIANT_TYPE_BOOLEAN, g_variant_new_boolean(TRUE));
53
54=== modified file 'libdbusmenu-glib/menuitem.h'
55--- libdbusmenu-glib/menuitem.h 2011-08-22 16:39:13 +0000
56+++ libdbusmenu-glib/menuitem.h 2011-12-13 00:11:23 +0000
57@@ -154,6 +154,18 @@
58 */
59 #define DBUSMENU_MENUITEM_PROP_ICON_DATA "icon-data"
60 /**
61+ * DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC:
62+ *
63+ * #DbusmenuMenuitem property used to provide a textual description of any
64+ * information that the icon may convey. The contents of this property are
65+ * passed through to assistive technologies such as the Orca screen reader.
66+ * The contents of this property will not be visible in the menu item. If
67+ * this property is set, Orca will use this property instead of the label
68+ * property.
69+ * Type: #G_VARIANT_TYPE_STRING
70+ */
71+#define DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC "accessible-desc"
72+/**
73 * DBUSMENU_MENUITEM_PROP_TOGGLE_TYPE:
74 *
75 * #DbusmenuMenuitem property that says what type of toggle entry should
76
77=== modified file 'libdbusmenu-gtk/client.c'
78--- libdbusmenu-gtk/client.c 2011-11-10 22:49:27 +0000
79+++ libdbusmenu-gtk/client.c 2011-12-13 00:11:23 +0000
80@@ -32,6 +32,7 @@
81
82 #include <gtk/gtk.h>
83 #include <glib.h>
84+#include <atk/atk.h>
85
86 #include "client.h"
87 #include "menuitem.h"
88@@ -745,6 +746,9 @@
89 process_submenu(mi, gmi, variant, gtkclient);
90 } else if (!g_strcmp0(prop, DBUSMENU_MENUITEM_PROP_DISPOSITION)) {
91 process_disposition(mi, gmi, variant, gtkclient);
92+ } else if (!g_strcmp0(prop, DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC)) {
93+ atk_object_set_name(gtk_widget_get_accessible(GTK_WIDGET(gmi)), variant == NULL ? NULL :
94+ g_variant_get_string(variant, NULL));
95 }
96
97 return;
98@@ -890,6 +894,8 @@
99 process_toggle_state(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_TOGGLE_STATE));
100 process_submenu(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_CHILD_DISPLAY), client);
101 process_disposition(item, gmi, dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_DISPOSITION), client);
102+ atk_object_set_name(gtk_widget_Get_accessible(GTK_WIDGET)gmi)),
103+ g_variant_get_string(dbusmenu_menuitem_property_get_variant(item, DBUSMENU_MENUITEM_PROP_ACCESSIBLE_DESC)));
104 refresh_shortcut(client, item);
105
106 /* Oh, we're a child, let's deal with that */

Subscribers

People subscribed via source and target branches

to all changes: