GNOME Bugzilla – Bug 564751
[Accessibility] No way to override gtk-modules setting
Last modified: 2012-08-07 04:43:44 UTC
Because of #539840 and #117236, if you have accessibility enabled, atk-bridge and gail are now loaded automatically for any application that calls gtk_init (). This is clearly not a problem for strictly Gtk+ applications, but both Firefox and OpenOffice use Gtk+ for toolkit theming and integration, but at the same time need to provide their own accessibility implementation. Sadly, the same is true of the Mono Accessibility project (http://mono-project.com/Accessibility) that I hack on. The previous hack used by folks was to blank out the GTK_MODULES environment variable before gtk_init () was called. This conveniently only applied for the current application, and worked mostly well until the patch in #539840 was committed. Now, Gtk/Modules is correctly set (good), but since Gtk/Modules is now queried inside of gtk_init () (by a callback set up by _gtk_modules_init), the only way it can be overridden is to set the XSetting for the screen. And while that can be done before gtk_init () and then restored after, it's chock full of race conditions. What I'm hoping for is some way to stop the gail and atk-bridge modules from being started, either by blacklist or other means.
Created attachment 124813 [details] [review] proposed patch (beware: not tested yet, just posting for early review) Reasoning of this patch: g_object_get already calls gdk_screen_get_setting through gtk_settings_get_property. Using it instead of gdk_screen_get_setting in gtkmodules.c, we allow pre-setting the property before gtk_init, for custom purposes in the loading process of gtk-modules. I'll deal now with the dependencies of gtk+ to try to build it and hopefully test it.
If you modify the gtk-modules setting then the app won't see any more changes to the gtk-modules settings. That's not really acceptable, since accessibility modules are only one type of modules. Modules are also used for example, for event sound handling. === In terms of the patch, clearly the existing code where it calls gdk_screen_get_setting() rather than going through g_object_get_property() is odd and strange. But because it's odd and strange, I suspect that there's some reason for doing it that way. That may be discoverable from subversion history and/or past bugzilla comments.
I'd like to keep track on this bug
gtk modules are no longer relevant for a11y, since we've included gail into gtk and link against atk-bridge