summaryrefslogtreecommitdiff
path: root/vcl/unx/gtk/a11y
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-04-13 12:23:40 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-04-13 12:23:40 +0100
commit63bbcea2b96a2b5e8600fd3530618cfadcfd427b (patch)
tree0ee06b55f6d97abee15f463804a7c754e78b60a1 /vcl/unx/gtk/a11y
parent50bf044cfa87fde9bce2b6870e222f2e42a0519f (diff)
Related: lp#746375 ensure a deterministic shutdown order for globals
Diffstat (limited to 'vcl/unx/gtk/a11y')
-rw-r--r--vcl/unx/gtk/a11y/atkutil.cxx13
1 files changed, 10 insertions, 3 deletions
diff --git a/vcl/unx/gtk/a11y/atkutil.cxx b/vcl/unx/gtk/a11y/atkutil.cxx
index f7e849e44e87..16ff41058bb7 100644
--- a/vcl/unx/gtk/a11y/atkutil.cxx
+++ b/vcl/unx/gtk/a11y/atkutil.cxx
@@ -66,7 +66,14 @@
using namespace ::com::sun::star;
-static uno::WeakReference< accessibility::XAccessible > xNextFocusObject;
+namespace
+{
+ struct theNextFocusObject :
+ public rtl::Static< uno::WeakReference< accessibility::XAccessible >, theNextFocusObject>
+ {
+ };
+}
+
static guint focus_notify_handler = 0;
/*****************************************************************************/
@@ -80,7 +87,7 @@ atk_wrapper_focus_idle_handler (gpointer data)
focus_notify_handler = 0;
- uno::Reference< accessibility::XAccessible > xAccessible = xNextFocusObject;
+ uno::Reference< accessibility::XAccessible > xAccessible = theNextFocusObject::get();
if( xAccessible.get() == reinterpret_cast < accessibility::XAccessible * > (data) )
{
AtkObject *atk_obj = xAccessible.is() ? atk_object_wrapper_ref( xAccessible ) : NULL;
@@ -135,7 +142,7 @@ atk_wrapper_focus_tracker_notify_when_idle( const uno::Reference< accessibility:
if( focus_notify_handler )
g_source_remove(focus_notify_handler);
- xNextFocusObject = xAccessible;
+ theNextFocusObject::get() = xAccessible;
focus_notify_handler = g_idle_add (atk_wrapper_focus_idle_handler, xAccessible.get());
}