From: Rémi Bernon rbernon@codeweavers.com
--- dlls/win32u/window.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 4d310edcbb2..7c34c929406 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -1765,21 +1765,33 @@ static NTSTATUS get_window_region( HWND hwnd, BOOL surface, HRGN *region, RECT * static void update_surface_region( HWND hwnd ) { WND *win = get_win_ptr( hwnd ); - HRGN region; + HRGN region, shape; RECT visible;
if (!win || win == WND_DESKTOP || win == WND_OTHER_PROCESS) return; if (!win->surface) goto done;
+ if (get_window_region( hwnd, FALSE, &shape, &visible )) goto done; + if (shape) + { + region = NtGdiCreateRectRgn( 0, 0, visible.right - visible.left, visible.bottom - visible.top ); + NtGdiCombineRgn( shape, shape, region, RGN_AND ); + if (win->dwExStyle & WS_EX_LAYOUTRTL) NtUserMirrorRgn( hwnd, shape ); + NtGdiDeleteObjectApp( region ); + } + if (get_window_region( hwnd, TRUE, ®ion, &visible )) goto done; - if (!region) win->surface->funcs->set_region( win->surface, 0 ); + if (!region) win->surface->funcs->set_region( win->surface, shape ); else { NtGdiOffsetRgn( region, -visible.left, -visible.top ); + if (shape) NtGdiCombineRgn( region, region, shape, RGN_AND ); win->surface->funcs->set_region( win->surface, region ); NtGdiDeleteObjectApp( region ); }
+ if (shape) NtGdiDeleteObjectApp( shape ); + done: release_win_ptr( win ); }