Skip to content

Commit

Permalink
composite: Inhibit window background paint with manual subwindow redi…
Browse files Browse the repository at this point in the history
…rection

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ä <ville.syrjala@nokia.com>
Reviewed-by: Owen Taylor <otaylor@fishsoup.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
  • Loading branch information
Ville Syrjälä authored and keith-packard committed Aug 4, 2011
1 parent f1d75f3 commit 9504caf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions composite/compalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ compRedirectSubwindows (ClientPtr pClient, WindowPtr pWin, int update)
* critical output
*/
DamageExtSetCritical (pClient, TRUE);
pWin->inhibitBGPaint = TRUE;
}
return Success;
}
Expand Down Expand Up @@ -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);
}
Expand Down
1 change: 1 addition & 0 deletions include/windowstr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 4 additions & 0 deletions mi/miexpose.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9504caf

Please sign in to comment.