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 756147 - Calling gtk_init() with an open display doesn't initialize a11y
Calling gtk_init() with an open display doesn't initialize a11y
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
3.17.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2015-10-06 22:09 UTC by Christoph Reiter (lazka)
Modified: 2015-10-06 22:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix accessibility not getting initialized in gtk_init() if a default display is already set (1.57 KB, patch)
2015-10-06 22:09 UTC, Christoph Reiter (lazka)
committed Details | Review

Description Christoph Reiter (lazka) 2015-10-06 22:09:22 UTC
While looking at bug 656314 I noticed that calling gdk_init() before gtk_init() makes everything 40ms faster.

This is due to gtk_init() not calling _gtk_accessibility_init() if a display is already open.
Comment 1 Christoph Reiter (lazka) 2015-10-06 22:09:52 UTC
Created attachment 312771 [details] [review]
Fix accessibility not getting initialized in gtk_init() if a default display is already set

_gtk_accessibility_init() only gets called if the default
display changes, but in case gdk_init() is called before gtk_init()
the default display is already set and no property notification occurs.

This can happen quite easily in pygobject where
"from gi.repository import Gdk, Gtk"
will call gdk_init() followed by gtk_init() in the Python overrides.

This fixes it by checking for a default display in all cases.
Comment 2 Emmanuele Bassi (:ebassi) 2015-10-06 22:16:18 UTC
Review of attachment 312771 [details] [review]:

Looks good.
Comment 3 Emmanuele Bassi (:ebassi) 2015-10-06 22:17:12 UTC
Also, while we're at it: can we please, for the love of all that's good and pure in the Universe, make PyGObject stop calling the initializing functions when importing the modules? It's broken on many, many levels.
Comment 4 Christoph Reiter (lazka) 2015-10-06 22:26:31 UTC
Thanks

https://git.gnome.org/browse/gtk+/commit/?id=263cbd90a063afa214855e52e88908853d7a2b8d

(In reply to Emmanuele Bassi (:ebassi) from comment #3)
> Also, while we're at it: can we please, for the love of all that's good and
> pure in the Universe, make PyGObject stop calling the initializing functions
> when importing the modules? It's broken on many, many levels.

bug 731091