diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-10-16 02:19:08 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-10-16 02:19:08 +0000 |
commit | 6cbf1d037948b7b9fd9f2fe384e04c6daa1aa4d7 (patch) | |
tree | a948ccb2214c6c2b23568fec9a1f34f8a2177a5e | |
parent | 7165deb630057a980dcd16763867d3986957d617 (diff) | |
parent | ab61b7b9aee2e9f794dea1e6861f0fbc2d196164 (diff) | |
download | gtk+-6cbf1d037948b7b9fd9f2fe384e04c6daa1aa4d7.tar.gz |
Merge branch 'a11y-action-fixes' into 'master'
A11y action fixes
See merge request GNOME/gtk!2703
-rw-r--r-- | gtk/a11y/gtkatspiaction.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/gtk/a11y/gtkatspiaction.c b/gtk/a11y/gtkatspiaction.c index c33361e7cc..2c28c0fbbd 100644 --- a/gtk/a11y/gtkatspiaction.c +++ b/gtk/a11y/gtkatspiaction.c @@ -639,12 +639,12 @@ get_action_at_index (GtkActionMuxer *muxer, continue; if (real_pos == pos) - break; + return actions[i]; real_pos += 1; } - return actions[real_pos]; + return NULL; } static int @@ -678,12 +678,18 @@ widget_handle_method (GDBusConnection *connection, GtkAtSpiContext *self = user_data; GtkAccessible *accessible = gtk_at_context_get_accessible (GTK_AT_CONTEXT (self)); GtkWidget *widget = GTK_WIDGET (accessible); + GtkWidget *parent = gtk_widget_get_parent (widget); GtkActionMuxer *muxer = _gtk_widget_get_action_muxer (widget, FALSE); + GtkActionMuxer *parent_muxer = parent ? _gtk_widget_get_action_muxer (parent, FALSE) : NULL; if (muxer == NULL) return; - char **actions = gtk_action_muxer_list_actions (muxer, TRUE); + char **actions = NULL; + + if (muxer != parent_muxer) + actions = gtk_action_muxer_list_actions (muxer, TRUE); + int n_actions = actions != NULL ? g_strv_length (actions) : 0; /* XXX: We need more fields in the action API */ @@ -771,13 +777,19 @@ widget_handle_get_property (GDBusConnection *connection, GtkAtSpiContext *self = user_data; GtkAccessible *accessible = gtk_at_context_get_accessible (GTK_AT_CONTEXT (self)); GtkWidget *widget = GTK_WIDGET (accessible); + GtkWidget *parent = gtk_widget_get_parent (widget); GtkActionMuxer *muxer = _gtk_widget_get_action_muxer (widget, FALSE); + GtkActionMuxer *parent_muxer = parent ? _gtk_widget_get_action_muxer (parent, FALSE) : NULL; GVariant *res = NULL; if (muxer == NULL) return res; - char **actions = gtk_action_muxer_list_actions (muxer, TRUE); + char **actions = NULL; + + if (muxer != parent_muxer) + actions = gtk_action_muxer_list_actions (muxer, TRUE); + int n_actions = actions != NULL ? g_strv_length (actions) : 0; if (g_strcmp0 (property_name, "NActions") == 0) |