From dbff4f422c943a837f0098e921f831eb4a94ac11 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 3 Oct 2012 00:08:30 +0200 Subject: [PATCH] winex11: Copy the existing surface bits when a dirty rectangle is specified in UpdateLayeredWindow. --- dlls/winex11.drv/window.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 5d7e315d75d..ad18eff8d7c 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2398,17 +2398,26 @@ BOOL CDECL X11DRV_UpdateLayeredWindow( HWND hwnd, const UPDATELAYEREDWINDOWINFO if (!(hdc = CreateCompatibleDC( 0 ))) goto done; SelectObject( hdc, dib ); - if (!(ret = GdiAlphaBlend( hdc, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, - info->hdcSrc, - rect.left + (info->pptSrc ? info->pptSrc->x : 0), - rect.top + (info->pptSrc ? info->pptSrc->y : 0), - rect.right - rect.left, rect.bottom - rect.top, - (info->dwFlags & ULW_ALPHA) ? *info->pblend : blend ))) - goto done; surface->funcs->lock( surface ); - memcpy( dst_bits, src_bits, bmi->bmiHeader.biSizeImage ); - add_bounds_rect( surface->funcs->get_bounds( surface ), &rect ); + + if (info->prcDirty) + { + memcpy( src_bits, dst_bits, bmi->bmiHeader.biSizeImage ); + PatBlt( hdc, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, BLACKNESS ); + } + ret = GdiAlphaBlend( hdc, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, + info->hdcSrc, + rect.left + (info->pptSrc ? info->pptSrc->x : 0), + rect.top + (info->pptSrc ? info->pptSrc->y : 0), + rect.right - rect.left, rect.bottom - rect.top, + (info->dwFlags & ULW_ALPHA) ? *info->pblend : blend ); + if (ret) + { + memcpy( dst_bits, src_bits, bmi->bmiHeader.biSizeImage ); + add_bounds_rect( surface->funcs->get_bounds( surface ), &rect ); + } + surface->funcs->unlock( surface ); surface->funcs->flush( surface ); -- 2.11.4.GIT