From de31822eccf69a1daf36d287c9a18f2cc7b89ad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Fri, 20 Oct 2023 15:44:29 +0800 Subject: [PATCH] x11-display: Make subwindow redirection call mode specific This means that for X11 sessions we'll do it before any windows are mapped, and before any plugin implementation is started. Doing it before a plugin is started is important, because things that the plugin does during startup can have consequences on how compositing on Xorg works. For the Xwayland case, we'll do it relatively in the setup phase. It appears to have been harmless to do it later in the post-opened signal, but there is no harm in doing it as one of the earlier steps. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3089 Part-of: --- src/compositor/meta-compositor-x11.c | 2 ++ src/wayland/meta-xwayland.c | 1 + src/x11/meta-x11-display.c | 1 - 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/compositor/meta-compositor-x11.c b/src/compositor/meta-compositor-x11.c index 87ccff5fb..52d284245 100644 --- a/src/compositor/meta-compositor-x11.c +++ b/src/compositor/meta-compositor-x11.c @@ -188,6 +188,8 @@ meta_compositor_x11_manage (MetaCompositor *compositor, compositor_x11->have_x11_sync_object = meta_sync_ring_init (xdisplay); + meta_x11_display_redirect_windows (x11_display, display); + return TRUE; } diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c index ea9c27d74..7f2915cfe 100644 --- a/src/wayland/meta-xwayland.c +++ b/src/wayland/meta-xwayland.c @@ -1180,6 +1180,7 @@ on_x11_display_setup (MetaDisplay *display, { MetaX11Display *x11_display = meta_display_get_x11_display (display); + meta_x11_display_redirect_windows (x11_display, display); meta_xwayland_init_dnd (x11_display); meta_xwayland_init_xrandr (manager, x11_display); } diff --git a/src/x11/meta-x11-display.c b/src/x11/meta-x11-display.c index 3cbf82844..0ad52b9a0 100644 --- a/src/x11/meta-x11-display.c +++ b/src/x11/meta-x11-display.c @@ -307,7 +307,6 @@ on_x11_display_opened (MetaX11Display *x11_display, MetaDisplay *display) { meta_display_manage_all_xwindows (display); - meta_x11_display_redirect_windows (x11_display, display); } static void