From: Rémi Bernon rbernon@codeweavers.com
The surface clip region is the region of the window that is visible, the expose_surface rect is the rect that has been exposed from the host point of view.
We want to invalidate the part that has been exposed and is visible, so we need to subtract the complement of the visible region from the rect. --- dlls/winex11.drv/bitblt.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index 7a3785ae398..5963bf98f3d 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -1971,12 +1971,18 @@ HRGN expose_surface( struct window_surface *window_surface, const RECT *rect ) add_bounds_rect( &window_surface->bounds, &rc ); if (window_surface->clip_region) { + HRGN clipped = NtGdiCreateRectRgn( window_surface->rect.left, window_surface->rect.top, + window_surface->rect.right, window_surface->rect.bottom ); + NtGdiCombineRgn( clipped, clipped, window_surface->clip_region, RGN_DIFF ); + region = NtGdiCreateRectRgn( rect->left, rect->top, rect->right, rect->bottom ); - if (NtGdiCombineRgn( region, region, window_surface->clip_region, RGN_DIFF ) <= NULLREGION) + if (NtGdiCombineRgn( region, region, clipped, RGN_DIFF ) <= NULLREGION) { NtGdiDeleteObjectApp( region ); region = 0; } + + NtGdiDeleteObjectApp( clipped ); } window_surface_unlock( window_surface ); return region;