From: Rémi Bernon rbernon@codeweavers.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57302 --- dlls/winex11.drv/window.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-)
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index ab17cb40a1c..da855b67f59 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1399,12 +1399,10 @@ static void sync_client_position( struct x11drv_win_data *data, const struct win * * Move the window bits when a window is moved. */ -static void move_window_bits( HWND hwnd, Window window, const RECT *old_rect, const RECT *new_rect, - const RECT *old_client_rect, const RECT *new_client_rect, - const RECT *new_window_rect ) +static void move_window_bits( HWND hwnd, Window window, const struct window_rects *old_rects, + const struct window_rects *new_rects, const RECT *valid_rects ) { - RECT src_rect = *old_rect; - RECT dst_rect = *new_rect; + RECT src_rect = valid_rects[1], dst_rect = valid_rects[0]; HDC hdc_src, hdc_dst; INT code; HRGN rgn; @@ -1412,16 +1410,16 @@ static void move_window_bits( HWND hwnd, Window window, const RECT *old_rect, co
if (!window) { - OffsetRect( &dst_rect, -new_window_rect->left, -new_window_rect->top ); + OffsetRect( &dst_rect, -new_rects->window.left, -new_rects->window.top ); parent = NtUserGetAncestor( hwnd, GA_PARENT ); hdc_src = NtUserGetDCEx( parent, 0, DCX_CACHE ); hdc_dst = NtUserGetDCEx( hwnd, 0, DCX_CACHE | DCX_WINDOW ); } else { - OffsetRect( &dst_rect, -new_client_rect->left, -new_client_rect->top ); + OffsetRect( &dst_rect, -new_rects->client.left, -new_rects->client.top ); /* make src rect relative to the old position of the window */ - OffsetRect( &src_rect, -old_client_rect->left, -old_client_rect->top ); + OffsetRect( &src_rect, -old_rects->client.left, -old_rects->client.top ); if (dst_rect.left == src_rect.left && dst_rect.top == src_rect.top) return; hdc_src = hdc_dst = NtUserGetDCEx( hwnd, 0, DCX_CACHE ); } @@ -1458,8 +1456,8 @@ static void move_window_bits( HWND hwnd, Window window, const RECT *old_rect, co if (!window) { /* map region to client rect since we are using DCX_WINDOW */ - NtGdiOffsetRgn( rgn, new_window_rect->left - new_client_rect->left, - new_window_rect->top - new_client_rect->top ); + NtGdiOffsetRgn( rgn, new_rects->window.left - new_rects->client.left, + new_rects->window.top - new_rects->client.top ); NtUserRedrawWindow( hwnd, NULL, rgn, RDW_INVALIDATE | RDW_FRAME | RDW_ERASE | RDW_ALLCHILDREN ); } else NtUserRedrawWindow( hwnd, NULL, rgn, RDW_INVALIDATE | RDW_ERASE | RDW_ALLCHILDREN ); @@ -2530,13 +2528,11 @@ void X11DRV_MoveWindowBits( HWND hwnd, const struct window_rects *old_rects, { /* if we have an X window the bits will be moved by the X server */ if (!window && (valid_rects[0].left - valid_rects[1].left || valid_rects[0].top - valid_rects[1].top)) - move_window_bits( hwnd, 0, &old_rects->visible, &new_rects->visible, - &old_rects->client, &new_rects->client, &new_rects->window ); + move_window_bits( hwnd, 0, old_rects, new_rects, valid_rects ); } else { - move_window_bits( hwnd, window, &valid_rects[1], &valid_rects[0], - &old_rects->client, &new_rects->client, &new_rects->window ); + move_window_bits( hwnd, window, old_rects, new_rects, valid_rects ); } }