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



commit b45b03b063877d8020cd1839c907b390ae731f4c
Author: Sebastian Keller <skeller src gnome org>
Date:   Fri Jan 3 21:00:00 2020 +0100

    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

 src/compositor/meta-surface-actor-x11.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/compositor/meta-surface-actor-x11.c b/src/compositor/meta-surface-actor-x11.c
index 64702f88a..5a3acecff 100644
--- a/src/compositor/meta-surface-actor-x11.c
+++ b/src/compositor/meta-surface-actor-x11.c
@@ -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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]