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
This commit is contained in:
Olivier Fourdan 2019-12-06 15:13:03 +01:00
parent 4d5a86327a
commit c0038f6dac

View File

@ -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))