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
This commit is contained in:
Carlos Garnacho 2019-09-27 13:31:49 +02:00
parent f803b11626
commit 054165d406

View File

@ -101,6 +101,9 @@ _gtk_accessibility_override_atk_util (void)
{
AtkUtilClass *atk_class = ATK_UTIL_CLASS (g_type_class_ref (ATK_TYPE_UTIL));
if (atk_class->get_root)
return;
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;