diff -Nru unity-2d-4.12.0/debian/changelog unity-2d-4.12.0/debian/changelog --- unity-2d-4.12.0/debian/changelog 2011-09-29 16:58:34.000000000 +0200 +++ unity-2d-4.12.0/debian/changelog 2011-11-23 11:20:37.000000000 +0100 @@ -1,3 +1,10 @@ +unity-2d (4.12.0-0ubuntu1.1) oneiric-proposed; urgency=low + + * debian/patches/enable-a11y.diff: Enable Qt accessibility in Unity 2d, but + keep it disabled for launched applications (LP: #877358) + + -- Aurélien Gâteau Wed, 23 Nov 2011 11:20:11 +0100 + unity-2d (4.12.0-0ubuntu1) oneiric; urgency=low * New upstream release diff -Nru unity-2d-4.12.0/debian/patches/enable-a11y.diff unity-2d-4.12.0/debian/patches/enable-a11y.diff --- unity-2d-4.12.0/debian/patches/enable-a11y.diff 1970-01-01 01:00:00.000000000 +0100 +++ unity-2d-4.12.0/debian/patches/enable-a11y.diff 2011-11-23 10:53:29.000000000 +0100 @@ -0,0 +1,47 @@ +Index: unity-2d-4.12.0/libunity-2d-private/src/launcherapplication.cpp +=================================================================== +--- unity-2d-4.12.0.orig/libunity-2d-private/src/launcherapplication.cpp 2011-11-22 15:35:51.000000000 +0100 ++++ unity-2d-4.12.0/libunity-2d-private/src/launcherapplication.cpp 2011-11-22 16:01:17.000000000 +0100 +@@ -656,6 +656,10 @@ + return false; + } + ++ /* Disable a11y for child processes: it is just not stable enough. ++ See https://bugs.launchpad.net/ubuntu/+source/qt-at-spi/+bug/877358 */ ++ unsetenv("QT_ACCESSIBILITY"); ++ + GError* error = NULL; + + GdkWindow* root; +Index: unity-2d-4.12.0/libunity-2d-private/src/unity2dapplication.cpp +=================================================================== +--- unity-2d-4.12.0.orig/libunity-2d-private/src/unity2dapplication.cpp 2011-11-22 15:09:37.000000000 +0100 ++++ unity-2d-4.12.0/libunity-2d-private/src/unity2dapplication.cpp 2011-11-23 10:48:01.000000000 +0100 +@@ -41,6 +41,9 @@ + #include + #include + ++static const char* A11Y_SCHEMA = "org.gnome.desktop.interface"; ++static const char* A11Y_KEY = "toolkit-accessibility"; ++ + /////////////////////////////// + class PlatformFontTracker + { +@@ -119,6 +122,17 @@ + + Unity2dDebug::installHandlers(); + ++ /* Enable a11y for all Unity 2d components. ++ * See https://bugs.launchpad.net/ubuntu/+source/qt-at-spi/+bug/877358 ++ * ++ * Note: We cannot use the Qt bindings to dconf because it requires a ++ * QApplication object, which we don't have at this point. ++ */ ++ GObjectScopedPointer settings(g_settings_new(A11Y_SCHEMA)); ++ if (g_settings_get_boolean(settings.data(), A11Y_KEY)) { ++ qputenv("QT_ACCESSIBILITY", "1"); ++ } ++ + /* When the environment variable QT_GRAPHICSSYSTEM is not set, force + * graphics system to 'raster' instead of the default 'native' which on X11 + * is 'XRender'. 'XRender' defaults to using a TrueColor visual. We do diff -Nru unity-2d-4.12.0/debian/patches/series unity-2d-4.12.0/debian/patches/series --- unity-2d-4.12.0/debian/patches/series 1970-01-01 01:00:00.000000000 +0100 +++ unity-2d-4.12.0/debian/patches/series 2011-11-22 15:09:26.000000000 +0100 @@ -0,0 +1 @@ +enable-a11y.diff