~ubuntu-branches/ubuntu/precise/unity-2d/precise-updates

« back to all changes in this revision

Viewing changes to libunity-2d-private/src/unity2dapplication.cpp

  • Committer: Package Import Robot
  • Author(s): Aurélien Gâteau
  • Date: 2011-11-23 15:05:39 UTC
  • Revision ID: package-import@ubuntu.com-20111123150539-1flcw3o7wxh1ox7n
Tags: 4.12.0-0ubuntu2
Enable accessibility at startup, disable it for started applications
(LP: #877358)

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
#include <gtk/gtk.h>
42
42
#include <pango/pango.h>
43
43
 
 
44
static const char* A11Y_SCHEMA = "org.gnome.desktop.interface";
 
45
static const char* A11Y_KEY = "toolkit-accessibility";
 
46
 
44
47
///////////////////////////////
45
48
class PlatformFontTracker
46
49
{
119
122
 
120
123
    Unity2dDebug::installHandlers();
121
124
 
 
125
    /* Enable a11y for all Unity 2d components.
 
126
     * See https://bugs.launchpad.net/ubuntu/+source/qt-at-spi/+bug/877358
 
127
     *
 
128
     * Note: We cannot use the Qt bindings to dconf because it requires a
 
129
     * QApplication object, which we don't have at this point.
 
130
     */
 
131
    GObjectScopedPointer<GSettings> settings(g_settings_new(A11Y_SCHEMA));
 
132
    if (g_settings_get_boolean(settings.data(), A11Y_KEY)) {
 
133
        qputenv("QT_ACCESSIBILITY", "1");
 
134
    }
 
135
 
122
136
    /* When the environment variable QT_GRAPHICSSYSTEM is not set, force
123
137
     * graphics system to 'raster' instead of the default 'native' which on X11
124
138
     * is 'XRender'.  'XRender' defaults to using a TrueColor visual. We do