GNOME Bugzilla – Bug 702753
gnome-shell does something wrong with images (breaking pyatspi .get_image*() methods)
Last modified: 2021-07-05 14:12:38 UTC
Created attachment 247332 [details] testing script Description of problem: When trying to discover which notification is urgent and which is not, I try to investigate which icon is shown in the gnome-shell. With the attached script I generate a notification via libnotify and then I try to investigate it with pyatspi (usually I would use dogtail, but in order to eliminate its possible guilt in the action, I am using only plain pyatspi). The result of running this script on my system is matej@wycliff: libnotify (rhel-7 *%)$ ./sample_reproducer.py DEBUG:<module>:found 173 icon elements. DEBUG:<module>:images = None ('summary', <Accessible object at 0x7f67c9807910 (AtspiAccessible at 0x10fe5d0)>) matej@wycliff: libnotify (rhel-7 *%)$ I don't think that line DEBUG:<module>:images = None is right. In order to eliminate possible bug with pyatspi I have also created this simple testing script: #!/usr/bin/python # -*- coding: utf-8 -*- import pyatspi, sys from pyatspi.utils import findAllDescendants, findDescendant def isAppNamed(node): return (node.getRoleName() == 'application') and \ (node.name == appname) appname = sys.argv[1] root = pyatspi.Registry.getDesktop(0) app = findDescendant(root, isAppNamed, breadth_first=True) print("app = %s" % app) icons = findAllDescendants(app, lambda x: x.getRoleName() == 'image') print("found %d icon elements." % len(icons)) for ico in icons: print("images = %s" % icons[0].get_image()) When I run it against for example Firefox (e.g., running ./app_reproducer.py Firefox) I get number of informations about images. Therefore the only culprit seems to me to be gnome-shell which somehow doesn't provide to pyatspi proper information. That unfortunately breaks my QA efforts. Version-Release number of selected component (if applicable): pyatspi-2.8.0-2.el7.noarch gnome-shell-3.8.3-2.el7.x86_64 How reproducible: 100% Steps to Reproduce: 1.run the above shown script for Firefox to see pyatspi API is working 2.run ./sample_reproducer.py 3. Actual results: see above Expected results: the .get_icon*() methods should return proper data for the icons. Also filed as https://bugzilla.redhat.com/show_bug.cgi?id=976440
Created attachment 247333 [details] universal testing script Of course the testing script I have pasted into the text of the bug has a bug itself. This is a corrected version.
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, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/ Thank you for your understanding and your help.