From f3a33e9bd1bfeefe97e268ab335bb80ccc3e8ef3 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 657f9bdb6..ea06c85fd 100644 --- a/src/compositor/meta-compositor-x11.c +++ b/src/compositor/meta-compositor-x11.c @@ -190,6 +190,8 @@ meta_compositor_x11_manage (MetaCompositor *compositor, compositor_x11->have_x11_sync_object = meta_sync_ring_init (cogl_context, 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 3366f11ad..db0a4a271 100644 --- a/src/wayland/meta-xwayland.c +++ b/src/wayland/meta-xwayland.c @@ -1179,6 +1179,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 6b8d7faf5..6de0511dc 100644 --- a/src/x11/meta-x11-display.c +++ b/src/x11/meta-x11-display.c @@ -308,7 +308,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