From c0038f6dac088c2b15f5e10de89a495b5abe71e0 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Fri, 6 Dec 2019 15:13:03 +0100 Subject: [PATCH] window-actor/x11: Update shape even when frozen On Xwayland, freezing actor updates on sync requests means the server-side frame and shadows repaint will be frozen as well, which causes the shadow to show black at times when resizing X11 clients which support NET_WM_SYNC. Using freeze/thaw commits prevents the content from changing, yet the shape window still needs to be updated when frozen otherwise the difference in shape induced by the on-going resize operation will show as well, even if the toplevel window has its commits frozen. https://gitlab.gnome.org/GNOME/mutter/merge_requests/942 Closes: https://bugzilla.gnome.org/show_bug.cgi?id=767212 Closes: https://gitlab.gnome.org/GNOME/mutter/issues/858 --- src/compositor/meta-window-actor-x11.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/compositor/meta-window-actor-x11.c b/src/compositor/meta-window-actor-x11.c index f5b18414e..11816bbeb 100644 --- a/src/compositor/meta-window-actor-x11.c +++ b/src/compositor/meta-window-actor-x11.c @@ -1111,17 +1111,28 @@ handle_updates (MetaWindowActorX11 *actor_x11) MetaSurfaceActor *surface = meta_window_actor_get_surface (META_WINDOW_ACTOR (actor_x11)); - if (meta_window_actor_is_frozen (META_WINDOW_ACTOR (actor_x11))) - { - /* The window is frozen due to a pending animation: we'll wait until - * the animation finishes to reshape and repair the window */ - return; - } - if (META_IS_SURFACE_ACTOR_X11 (surface) && meta_surface_actor_x11_is_unredirected (META_SURFACE_ACTOR_X11 (surface))) return; + if (meta_window_actor_is_frozen (META_WINDOW_ACTOR (actor_x11))) + { + MetaWindow *window = + meta_window_actor_get_meta_window (META_WINDOW_ACTOR (actor_x11)); + + /* The window is frozen due to a pending animation: we'll wait until + * the animation finishes to repair the window. + * + * However, with Xwayland, we still might need to update the shape + * region as the wl_buffer will be set to plain black on resize, + * which causes the shadows to look bad. + */ + if (surface && meta_window_x11_always_update_shape (window)) + update_shape_region (actor_x11); + + return; + } + meta_surface_actor_pre_paint (surface); if (!meta_surface_actor_is_visible (surface))