[gtk/wip/carlosg/atk-util-checks] a11y: Avoid clobbering AtkUtilClass vmethods



commit 054165d4060b3fbc8c7bbc6b37580e1f90db376b
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 | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/gtk/a11y/gtkaccessibilityutil.c b/gtk/a11y/gtkaccessibilityutil.c
index 1ba892bad5..b6f909f294 100644
--- a/gtk/a11y/gtkaccessibilityutil.c
+++ b/gtk/a11y/gtkaccessibilityutil.c
@@ -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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]