summaryrefslogtreecommitdiff
path: root/src
diff options
authorAlejandro Piñeiro <apinheiro@igalia.com>2011-01-31 14:38:14 +0100
committerLoïc Molinari <loic.molinari@canonical.com>2011-01-31 14:38:14 +0100
commitfb94897ed4398d3e5066b0ea36d0c099720127c1 (patch)
tree7c9fc28c4bf8bdf03c14d4977c1e8c5929a9197e /src
parent27a5c813c184ee469c1a1041ed1883793a366d35 (diff)
[a11y] Added init check system (reintegrating fix reverted in r790)
(bzr r801)
Diffstat (limited to 'src')
-rw-r--r--src/unitya11y.cpp12
-rw-r--r--src/unitya11y.h1
-rw-r--r--src/unityshell.cpp3
3 files changed, 15 insertions, 1 deletions
diff --git a/src/unitya11y.cpp b/src/unitya11y.cpp
index aad3b5e80..358366ac0 100644
--- a/src/unitya11y.cpp
+++ b/src/unitya11y.cpp
@@ -38,6 +38,8 @@
static GHashTable *accessible_table = NULL;
/* FIXME: remove accessible objects when not required anymore */
+static gboolean a11y_initialized = FALSE;
+
static void
unity_a11y_restore_environment (void)
{
@@ -190,6 +192,7 @@ unity_a11y_init (void)
{
g_debug ("Unity accessibility started, using bridge on %s",
bridge_path);
+ a11y_initialized = TRUE;
}
g_free (bridge_path);
@@ -208,6 +211,7 @@ unity_a11y_finalize (void)
g_hash_table_unref (accessible_table);
accessible_table = NULL;
}
+ a11y_initialized = FALSE;
}
@@ -290,3 +294,11 @@ unity_a11y_get_accessible (nux::Object *object)
return accessible_object;
}
+
+/*
+ * Returns if the accessibility support is properly initialized
+ */
+gboolean unity_a11y_initialized (void)
+{
+ return a11y_initialized;
+}
diff --git a/src/unitya11y.h b/src/unitya11y.h
index a583fd1bd..7e0768407 100644
--- a/src/unitya11y.h
+++ b/src/unitya11y.h
@@ -28,5 +28,6 @@ void unity_a11y_preset_environment (void);
void unity_a11y_init (void);
void unity_a11y_finalize (void);
AtkObject *unity_a11y_get_accessible (nux::Object *object);
+gboolean unity_a11y_initialized (void);
#endif /* UNITY_A11Y_H */
diff --git a/src/unityshell.cpp b/src/unityshell.cpp
index a6d094ee2..7d2f83aac 100644
--- a/src/unityshell.cpp
+++ b/src/unityshell.cpp
@@ -553,7 +553,8 @@ void UnityScreen::initLauncher (nux::NThread* thread, void* InitData)
/* FIXME: this should not be manual, should be managed with a
show/hide callback like in GAIL*/
- unity_util_accessible_add_window (self->launcherWindow);
+ if (unity_a11y_initialized () == TRUE)
+ unity_util_accessible_add_window (self->launcherWindow);
self->launcher->SetIconSize (54, 48);
self->launcher->SetBacklightAlwaysOn (true);