[gtk/wip/carlosg/atk-util-checks] a11y: Avoid clobbering AtkUtilClass vmethods
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/carlosg/atk-util-checks] a11y: Avoid clobbering AtkUtilClass vmethods
- Date: Fri, 27 Sep 2019 12:09:52 +0000 (UTC)
commit bb9ba1562fe9a42611f7f28ea0c3482a5c3b52c4
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Sep 27 13:31:49 2019 +0200
a11y: Avoid clobbering AtkUtilClass vmethods
In the unlikely case that GTK is "embedded" with other toolkits
(hi, Mutter), GTK will clobber the embedder's AtkUtil implementation,
leaving its own a11y in a broken state.
AtkUtil is not meant to be overridden by multiple toolkits within a
single client, so the most sensible thing to do is stay away from it
if that is the case. This helps the embedder's a11y to win.
Fixes Clutter a11y in Mutter after xwayland-on-demand, process
startup used to be in a fixed order so that Clutter's a11y would
eventually win, but x11/gtk startup is now asynchronous and able to
happen at a later point.
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1687
gtk/a11y/gtkaccessibilityutil.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/gtk/a11y/gtkaccessibilityutil.c b/gtk/a11y/gtkaccessibilityutil.c
index 1ba892bad5..fa54a1d1c0 100644
--- a/gtk/a11y/gtkaccessibilityutil.c
+++ b/gtk/a11y/gtkaccessibilityutil.c
@@ -101,11 +101,16 @@ _gtk_accessibility_override_atk_util (void)
{
AtkUtilClass *atk_class = ATK_UTIL_CLASS (g_type_class_ref (ATK_TYPE_UTIL));
- atk_class->add_key_event_listener = add_key_event_listener;
- atk_class->remove_key_event_listener = remove_key_event_listener;
- atk_class->get_root = get_root;
- atk_class->get_toolkit_name = get_toolkit_name;
- atk_class->get_toolkit_version = get_toolkit_version;
+ if (!atk_class->add_key_event_listener)
+ atk_class->add_key_event_listener = add_key_event_listener;
+ if (!atk_class->remove_key_event_listener)
+ atk_class->remove_key_event_listener = remove_key_event_listener;
+ if (!atk_class->get_root)
+ atk_class->get_root = get_root;
+ if (!atk_class->get_toolkit_name)
+ atk_class->get_toolkit_name = get_toolkit_name;
+ if (!atk_class->get_toolkit_version)
+ atk_class->get_toolkit_version = get_toolkit_version;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]