From fb94897ed4398d3e5066b0ea36d0c099720127c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Pi=C3=B1eiro?= Date: Mon, 31 Jan 2011 14:38:14 +0100 Subject: [a11y] Added init check system (reintegrating fix reverted in r790) (bzr r801) --- src/unitya11y.cpp | 12 ++++++++++++ src/unitya11y.h | 1 + src/unityshell.cpp | 3 ++- 3 files changed, 15 insertions(+), 1 deletion(-) (limited to 'src') 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); -- cgit v1.2.3