After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 788517 - Can't get Button caption when accessibility name is set
Can't get Button caption when accessibility name is set
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Accessibility
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2017-10-04 14:28 UTC by Marcin
Modified: 2018-05-02 19:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Example App that demonstrate the issue (978 bytes, text/plain)
2017-10-05 21:32 UTC, Marcin
Details

Description Marcin 2017-10-04 14:28:15 UTC
When the Accessibility name of ATSPI_ROLE_PUSH_BUTTON is set, there's no way to obtain it's caption/text.
Comment 1 Marcin 2017-10-04 14:29:25 UTC
I need it because I want to find the button and check if it contains specific text on it. 

Needed for example to test string translation etc.
Comment 2 Matthias Clasen 2017-10-05 19:21:28 UTC
well, this is an accessibility api, not a translation testing api.
Comment 3 Daniel Boles 2017-10-05 19:48:57 UTC
Yeah, is there some reason you can't just use gtk_button_get_label()? If the type of widget may vary, you can check it using e.g. if (GTK_IS_BUTTON (widget)), etc.
Comment 4 Marcin 2017-10-05 20:39:24 UTC
Daniel, 
I can't use gtk_button_get_label as I'm trying to access the button from external application, for example python script or accerciser. 


Matthias,
it was just an example to demonstrate the problem, still a good one imho.
Comment 5 Marcin 2017-10-05 21:32:16 UTC
Created attachment 361001 [details]
Example App that demonstrate the issue

In this app first button got the Accessibility name.
When Accerciser is used to inspect the buttons, the first one will be seen as "this is acc name" while the second as "Close"
The problem occurs when one will try to inspect/access first button caption. 
With the current Gtk/Atk implementation it's not possible.
Comment 6 Daniel Boles 2017-10-05 21:51:08 UTC
to clarify, on IRC it has become clearer that what Marcin would like is for the button's a11y object to implement the AtkText interface
Comment 7 Marcin 2017-10-05 22:03:39 UTC
to clarify more I need anything that will allow me to access using atk the button caption when acc name has been set for it. 
Be it AtkText, or new property, doesn't really matter.
Comment 8 Matthias Clasen 2017-10-07 19:41:41 UTC
I still think this is a wontfix. Implementing the text interface is not trivial, and I don't see a justification for carrying all that extra code
Comment 9 GNOME Infrastructure Team 2018-05-02 19:12:35 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk/issues/933.