summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2021-02-23 18:14:17 +0100
committerJonas Ådahl <jadahl@gmail.com>2021-02-23 18:21:09 +0100
commitbd923035d484956340f47674013a1518268172f8 (patch)
tree1a96179e5d7f7cad860702b5b8c21a2c9afffb54
parent2432508db78a235abc5cee198fb94043625db65f (diff)
downloadmutter-bd923035d484956340f47674013a1518268172f8.tar.gz
x11-display: Set NO_AT_BRIDGE to 1 while opening the GDK display
gnome-shell has this hack where it sets the environment variable "NO_AT_BRIDGE" to "1" before calling meta_init() and then unsets it after meta_init() returns. This variable being set to "1" will then cause the ATK bridge in at-spi2-gtk to fail to load, which GTK then ignores. This is on purpose, since accessibility is supposed to be done done by GNOME Shell via Clutter, not via GTK. The problem is that, now, by default, setting "NO_AT_BRIDGE" to "1" during meta_init() only has the desired effect on an X11 session, where we always connect to the X11 server on startup (i.e. during meta_init()). With Xwayland on-demand, we do not attempt to create the GDK display during meta_init(), thus this hack falls apart. Since there are no real altenatives to this hack, just move it to mutter, which have a better idea when GDK displays are created or not. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1744>
-rw-r--r--src/x11/meta-x11-display.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/x11/meta-x11-display.c b/src/x11/meta-x11-display.c
index 156304d6b..e25e3a368 100644
--- a/src/x11/meta-x11-display.c
+++ b/src/x11/meta-x11-display.c
@@ -1059,6 +1059,7 @@ meta_x11_init_gdk_display (GError **error)
const char *xdisplay_name;
GdkDisplay *gdk_display;
const char *gdk_gl_env = NULL;
+ const char *old_no_at_bridge;
Display *xdisplay;
xdisplay_name = meta_x11_get_display_name ();
@@ -1082,7 +1083,10 @@ meta_x11_init_gdk_display (GError **error)
return FALSE;
}
+ old_no_at_bridge = g_getenv ("NO_AT_BRIDGE");
+ g_setenv ("NO_AT_BRIDGE", "1", TRUE);
gdk_display = gdk_display_open (xdisplay_name);
+ g_setenv ("NO_AT_BRIDGE", old_no_at_bridge, TRUE);
if (!gdk_display)
{