Module: wine Branch: master Commit: ba9e0b5522387f308c378199b1198f83643db12a URL: https://gitlab.winehq.org/wine/wine/-/commit/ba9e0b5522387f308c378199b1198f8...
Author: Rémi Bernon rbernon@codeweavers.com Date: Wed Jun 19 21:34:24 2024 +0200
winex11: Only clip huge surfaces to the virtual screen rect.
---
dlls/winex11.drv/bitblt.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index c4ae4dd522e..715d263028f 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -2186,10 +2186,18 @@ HRGN expose_surface( struct window_surface *window_surface, const RECT *rect )
BOOL get_surface_rect( const RECT *visible_rect, RECT *surface_rect ) { - *surface_rect = NtUserGetVirtualScreenRect(); + RECT virtual_rect = NtUserGetVirtualScreenRect();
- if (!intersect_rect( surface_rect, surface_rect, visible_rect )) return FALSE; + *surface_rect = *visible_rect; + + /* crop surfaces which are larger than the virtual screen rect, some applications create huge windows */ + if ((surface_rect->right - surface_rect->left > virtual_rect.right - virtual_rect.left || + surface_rect->bottom - surface_rect->top > virtual_rect.bottom - virtual_rect.top) && + !intersect_rect( surface_rect, surface_rect, &virtual_rect )) + return FALSE; OffsetRect( surface_rect, -visible_rect->left, -visible_rect->top ); + + /* round the surface coordinates to avoid re-creating them too often on resize */ surface_rect->left &= ~31; surface_rect->top &= ~31; surface_rect->right = max( surface_rect->left + 32, (surface_rect->right + 31) & ~31 );