surface-actor-x11: Avoid flicker when (un)redirecting windows

Currently when a window is requested to be unredirected, the
corresponding pixmap and texture can get cleared before the window has
been unredirected by the X server. This can result in the windows behind
showing through which causes a short flicker after showing an OSD or
notification when a fullscreen application is running.
Fix this by ensuring the texture is only cleared after the window has
been unredirected by the server.

Similarly when the window is being redirected again, the pixmap of the
window can only be requested after the redirection has been completed by
the server. This currently can happen in a different frame than the next
redraw of the actor resulting in an empty texture until the next redraw.
Fix this by queuing a redraw immediately after redirecting.

Fixes https://gitlab.gnome.org/GNOME/mutter/issues/997
This commit is contained in:
Sebastian Keller 2020-01-03 21:00:00 +01:00 committed by Jonas Ådahl
parent c06fae4741
commit b45b03b063

View File

@ -300,12 +300,15 @@ sync_unredirected (MetaSurfaceActorX11 *self)
if (self->unredirected)
{
detach_pixmap (self);
XCompositeUnredirectWindow (xdisplay, xwindow, CompositeRedirectManual);
XSync (xdisplay, False);
detach_pixmap (self);
}
else
{
XCompositeRedirectWindow (xdisplay, xwindow, CompositeRedirectManual);
XSync (xdisplay, False);
clutter_actor_queue_redraw (CLUTTER_ACTOR (self));
}
meta_x11_error_trap_pop (display->x11_display);