GNOME Bugzilla – Bug 647482
There are some overlapped methods on the ATK namespace
Last modified: 2021-06-10 11:26:08 UTC
While toying with atk javascript bindings on GNOME Shell we found that some of the methods are overlapped. One example is atk_object_get_name and atk_action_get_name. In C this is not a problem, as you need to include the namespace on the method call, but not on a object oriented language, where you do something like this: object.get_name And in fact, the output is not deterministic: * javascript: object.get_name calls atk_object_get_name * python: object.get_name calls atk_action_get_name In the case of python there is a way to workaround this issue, but on javascript we didn't found it. In order to solve that, we would require to provide non-overlapping methods. In this case, something like this: * atk_object_get_accessible_name (as the property name) * atk_action_get_action_name or atk_action_get_nth_name But this is just an example. It is required to make a full review of ATK API to check if there is more cases. ADDITIONAL INFORMATION: Original thread with this issue: https://mail.gnome.org/archives/gnome-shell-list/2010-August/msg00017.html More about introspection and ATK: bug 640625
Created attachment 185743 [details] Testing the overlapped method on python This is a little example that shows the overlapping problem on python. It also workarounds the problem in order to call the proper ones. This workaround shouldn't be required.
[Mass-reassigning open atk bug reports for better trackability as requested in https://bugzilla.gnome.org/show_bug.cgi?id=653179 . PLEASE NOTE: If you have watched the previous assignee of this bug report as a workaround for actually getting notified of changes in atk bugs, you yourself will now have to add atk-maint@gnome.bugs to your watchlist at the bottom of https://bugzilla.gnome.org/userprefs.cgi?tab=email to keep watching atk bug reports in GNOME Bugzilla. Sorry for the noise: Feel free to filter for this comment in order to mass-delete the triggered bugmail.]
While reading recent thread about gir stability: http://mail.gnome.org/archives/gtk-devel-list/2012-January/msg00140.html It was mentioned a annotation "Rename to:" So, one option could be found those overlapping methods and use that annotation to expose it with a different name. In theory with the name that we plan to use in the future. For example, on atk_action_get_name, add a annotation like this: Rename to: atk_action_get_action_name Pros and cons: + We could solve this problem at ATK 2.0, as it doesn't require a ATK 2.0 C API breakage + We could start to use the "new method" names required - It can be method-confusing. Right now gir are used for bindings, but not for creating documentation. So Javascript developers still needs to use C API reference to check the method names. But we are saying here that we are renaming it. - About confusion: we could introduce the same problems suggested by Ryan Lortie on that thread
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version of atk, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a ticket at https://gitlab.gnome.org/GNOME/atk/-/issues/ Thank you for your understanding and your help.