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 503091 - pyatspi getApplication doesn't fallback properly
pyatspi getApplication doesn't fallback properly
Status: RESOLVED FIXED
Product: pyatspi2
Classification: Applications
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Willie Walker
Li Yuan
Depends on:
Blocks:
 
 
Reported: 2007-12-11 18:32 UTC by Willie Walker
Modified: 2019-03-27 20:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to walk the hierarchy if the real getAccessible fails or returns None. Also narrows the return value to an Application. (1.63 KB, patch)
2007-12-11 18:35 UTC, Willie Walker
committed Details | Review

Description Willie Walker 2007-12-11 18:32:38 UTC
There is code in pyatspi's accessible.py:getApplication to fallback to walking up the hierarchy if the actual getApplication doesn't work.  The problem is that some toolkits (e.g., Java) don't implement this method, and return None.  As such, the current code to walk up the hierarchy never gets called.

A second problem is that if the code to walk up the hierarchy does get called, it returns an object that is an Accessible and not an Application.

Patch to follow...
Comment 1 Willie Walker 2007-12-11 18:35:36 UTC
Created attachment 100773 [details] [review]
Patch to walk the hierarchy if the real getAccessible fails or returns None.  Also narrows the return value to an Application.

This patch seems to work nicely for me with the Java platform.
Comment 2 Eitan Isaacson 2007-12-13 14:45:17 UTC
It looks fine to me. Yo.
Comment 3 Willie Walker 2007-12-14 00:13:27 UTC
Committed.  Thanks!
Comment 4 Willie Walker 2008-01-13 00:02:43 UTC
(In reply to comment #3)
> Committed.  Thanks!
> 

I was checking my pyatspi directory today, and apparently my commit didn't work.  So, I just committed it for the GNOME 2.21.5 release.