diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2015-08-10 20:16:16 +0100 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2016-11-17 13:15:44 +0000 |
commit | 765978474c9fd9ddb030f201930f02507832cc7d (patch) | |
tree | 4cc3e5d91e2a4098fc18744076ac602db09402c5 | |
parent | 6a7f1f59a97e60089dbbccb4cfe5847678977a6b (diff) |
Avoid artefacts when resizing a window
Fill the area outside the current window size with black, rather than leaking
frambuffer contents or leaving it undrawn.
-rw-r--r-- | hw/xwin/winshadgdi.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/hw/xwin/winshadgdi.c b/hw/xwin/winshadgdi.c index e6dfc4c8d..86f381e8f 100644 --- a/hw/xwin/winshadgdi.c +++ b/hw/xwin/winshadgdi.c @@ -929,6 +929,30 @@ winBltExposedWindowRegionShadowGDI(ScreenPtr pScreen, WindowPtr pWin) } } + /* If part of the invalidated region is outside the window (which can happen + if the native window is being re-sized), fill that area with black */ + if (ps.rcPaint.right > ps.rcPaint.left + pWin->drawable.width) { + BitBlt(hdcUpdate, + ps.rcPaint.left + pWin->drawable.width, + ps.rcPaint.top, + ps.rcPaint.right - (ps.rcPaint.left + pWin->drawable.width), + ps.rcPaint.bottom - ps.rcPaint.top, + NULL, + 0, 0, + BLACKNESS); + } + + if (ps.rcPaint.bottom > ps.rcPaint.top + pWin->drawable.height) { + BitBlt(hdcUpdate, + ps.rcPaint.left, + ps.rcPaint.top + pWin->drawable.height, + ps.rcPaint.right - ps.rcPaint.left, + ps.rcPaint.bottom - (ps.rcPaint.top + pWin->drawable.height), + NULL, + 0, 0, + BLACKNESS); + } + /* EndPaint frees the DC */ EndPaint(hWnd, &ps); |