Bug 24108 - Allow at-spi2-atk files to co-exist with AT-SPI/CORBA
Summary: Allow at-spi2-atk files to co-exist with AT-SPI/CORBA
Status: NEW
Alias: None
Product: at-spi2
Classification: Unclassified
Component: atk (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Mark Doffman
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 24106
Blocks:
  Show dependency treegraph
 
Reported: 2009-09-23 06:09 UTC by Willie Walker
Modified: 2009-10-01 12:46 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Patch (6.07 KB, patch)
2009-09-23 06:11 UTC, Willie Walker
Details | Splinter Review
Patch to rename bridge back to atk-bridge and allow relocation of pyatspi and GTK module (4.99 KB, patch)
2009-10-01 12:46 UTC, Willie Walker
Details | Splinter Review

Description Willie Walker 2009-09-23 06:09:16 UTC
This patch is related to bug #24106, except it allows the atk portion of the AT-SPI/D-Bus implementation to co-exist on the file system with the AT-SPI/CORBA files.

A summary of the changes is as follows:

* Wherever we use the string 'spi', a '2' is appended.  For example,

-gtkmodule_LTLIBRARIES = libspiatk.la
+gtkmodule_LTLIBRARIES = libspi2atk.la

* The pyatspi implementation is installed under a 'pyatspi2/pyatspi' directory and a pyatspi.pth file is installed.  This pyatspi.pth file performs the following trickery to pre-pend sys.path with the pyatspi2 directory if the "/desktop/gnome/interface/accessibility2" gconf setting is set:

import commands, sys; a = commands.getoutput('gconftool-2 --get /desktop/gnome/
interface/accessibility2'); (a == 'true') and sys.path.insert(0, '@prefix@/lib/p
ython@PYTHON_VERSION@/site-packages/pyatspi2')

The general notion is to unset /desktop/gnome/interface/accessibility to turn off the CORBA implementation and set /desktop/gnome/interface/accessibility2 to turn on the new implementation.

gconftool-2 --set /desktop/gnome/interface/accessibility --type bool false
gconftool-2 --set /desktop/gnome/interface/accessibility2 --type bool true

Note also that creating/setting a new gnome_settings_daemon property can be useful.  This tells it to load gail:spi2atk as GTK_MODULES if the /desktop/gnome/interface/accessibility2 setting is set:

gconftool-2 --set /apps/gnome_settings_daemon/gtk-modules/gail:spi2atk --type string /desktop/gnome/interface/accessibility2

When we ultimately decide to completely drop CORBA for GNOME 3.0, we'll
need to make the following changes:

* Drop the '2' suffix.  The occurrences of this can be found by running 
  the following command on a freshly cloned space:

find . -type f | xargs egrep -i spi2

* No longer put pyatspi under a pyatspi2/pyatspi directory.

* Consider renaming spi2atk to atk-bridge so as to allow Firefox and other toolkits that hardcode atk-bridge into their a11y implementation to work without needing to be modified.
Comment 1 Willie Walker 2009-09-23 06:11:34 UTC
Created attachment 29802 [details] [review]
Patch
Comment 2 Mario Lang 2009-09-28 04:10:36 UTC
Hi.  I dont really understand the first item in this change:
-gtkmodule_LTLIBRARIES = libspiatk.la
+gtkmodule_LTLIBRARIES = libspi2atk.la

libspiatk (at-spi2) doesn't conflict with libatk-bridge (at-spi).
Can you explain why the added 2 is necessary in this case?
Comment 3 Willie Walker 2009-09-28 05:22:46 UTC
(In reply to comment #2)
> Hi.  I dont really understand the first item in this change:
> -gtkmodule_LTLIBRARIES = libspiatk.la
> +gtkmodule_LTLIBRARIES = libspi2atk.la
> 
> libspiatk (at-spi2) doesn't conflict with libatk-bridge (at-spi).
> Can you explain why the added 2 is necessary in this case?

It was mainly for consistency.  I believe this ended up being the sole spot where we saw spi without the "2".
Comment 4 Willie Walker 2009-10-01 12:46:09 UTC
Created attachment 29984 [details] [review]
Patch to rename bridge back to atk-bridge and allow relocation of pyatspi and GTK module 

This patch:

1) Renames the bridge back to atk-bridge so that applications that hard code the bridge module name (e.g., Firefox, OOo, and gdm all hardcode 'atk-bridge') can use it.

2) Sets up an autostart *.desktop file that connects to gnome-session at initialization time, telling it to set GTK_PATH so as to pick up the atk-bridge module if it has been relocated.  This *.desktop file is only run if the /desktop/gnome/interface/atspi-dbus gconf key is set.

3) Allows the pyatspi installation to be relocated via a PYATSPI_SUBDIR environment variable that is picked up during the autogen/configure phase.

4) If (and only if) pyatspi is relocated via the PYATSPI_SUBDIR environment variable, a pyatspi-dbus.pth file is installed in the system's python directory and it modifies sys.path to put the D-Bus-based pyatspi ahead of the CORBA-based pyatspi in sys.path, but only if the /desktop/gnome/interface/atspi-dbus gconf key is set.

Note that the existing /desktop/gnome/interface/accessibility value is still used to determine if the GTK+ a11y modules (e.g., gail:atk-bridge) should be loaded or not.

NOTE - after applying the patch, if you want to build/install at-spi2-atk in a
way that allows it to co-exist with the CORBA/Bonobo-based at-spi, you can do
this:

PYATSPI_SUBDIR=pyatspi-dbus ./autogen.sh --prefix=/opt/atspi-dbus --includedir=/opt/atspi-dbus/include --libdir=/opt/atspi-dbus/lib --exec-prefix=/usr --datarootdir=/usr/share

This puts *only* the *.desktop and pyatspi-dbus.pth files under /usr.  The rest of the files end up under /opt/atspi-dbus.  Then, when you set /desktop/gnome/interface/atspi-dbus to True, the *.desktop file will set GTK_PATH in gnome-session, causing every app to find the D-Bus atk-bridge before the CORBA atk-bridge.  The /desktop/gnome/interface/atspi-dbus key also has the impact of making the pyatspi-dbus.pth file tell python to find the D-Bus pyatspi before the CORBA pyatspi.

A nice effect of this patch and the one for bug #24106 is that it keeps they GNOME-specific stuff isolated to atk-bridge.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.