From 9504caf1c3243e3ab2eb7126bc2bb876a8f89918 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= Date: Fri, 6 May 2011 18:19:34 +0300 Subject: [PATCH] composite: Inhibit window background paint with manual subwindow redirection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The composite extension spec says that window background painting should be inhibited when the subwindow redirection mode is set to manual. This eliminates the ugly flashing effect when compiz unredirects a fullscreen window. Signed-off-by: Ville Syrjälä Reviewed-by: Owen Taylor Reviewed-by: Keith Packard Signed-off-by: Keith Packard --- composite/compalloc.c | 2 ++ include/windowstr.h | 1 + mi/miexpose.c | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/composite/compalloc.c b/composite/compalloc.c index 841b2dc11d..f00bf4eb00 100644 --- a/composite/compalloc.c +++ b/composite/compalloc.c @@ -434,6 +434,7 @@ compRedirectSubwindows (ClientPtr pClient, WindowPtr pWin, int update) * critical output */ DamageExtSetCritical (pClient, TRUE); + pWin->inhibitBGPaint = TRUE; } return Success; } @@ -466,6 +467,7 @@ compFreeClientSubwindows (WindowPtr pWin, XID id) */ DamageExtSetCritical (pClient, FALSE); csw->update = CompositeRedirectAutomatic; + pWin->inhibitBGPaint = FALSE; if (pWin->mapped) (*pWin->drawable.pScreen->ClearToBackground)(pWin, 0, 0, 0, 0, TRUE); } diff --git a/include/windowstr.h b/include/windowstr.h index 4a7a0f4884..222de31dcf 100644 --- a/include/windowstr.h +++ b/include/windowstr.h @@ -169,6 +169,7 @@ typedef struct _Window { #endif #ifdef COMPOSITE unsigned damagedDescendants:1; /* some descendants are damaged */ + unsigned inhibitBGPaint:1; /* paint the background? */ #endif } WindowRec; diff --git a/mi/miexpose.c b/mi/miexpose.c index 94258b8643..0f1ebe59c6 100644 --- a/mi/miexpose.c +++ b/mi/miexpose.c @@ -575,6 +575,10 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) tile_x_off = pWin->drawable.x - draw_x_off; tile_y_off = pWin->drawable.y - draw_y_off; fill = pWin->background; +#ifdef COMPOSITE + if (pWin->inhibitBGPaint) + return; +#endif switch (pWin->backgroundState) { case None: return;