From: Rémi Bernon rbernon@codeweavers.com
This is used to move pixels when drawing directly to the host window. In this case, the DC operations are all in window DPI, and DPI scaling isn't supported. --- dlls/win32u/driver.c | 3 ++- dlls/win32u/window.c | 6 +----- dlls/winex11.drv/window.c | 14 ++++++-------- dlls/winex11.drv/x11drv.h | 3 ++- include/wine/gdi_driver.h | 2 +- 5 files changed, 12 insertions(+), 16 deletions(-)
diff --git a/dlls/win32u/driver.c b/dlls/win32u/driver.c index 3e094264d15..38132edd15a 100644 --- a/dlls/win32u/driver.c +++ b/dlls/win32u/driver.c @@ -896,7 +896,8 @@ static BOOL nulldrv_CreateWindowSurface( HWND hwnd, BOOL layered, const RECT *su return FALSE; }
-static void nulldrv_MoveWindowBits( HWND hwnd, const struct window_rects *new_rects, const RECT *valid_rects ) +static void nulldrv_MoveWindowBits( HWND hwnd, const struct window_rects *old_rects, + const struct window_rects *new_rects, const RECT *valid_rects ) { }
diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index ab58cabb40e..dc59ce1e9fd 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -2101,11 +2101,7 @@ static BOOL apply_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, stru if (surface_win && surface_win != hwnd) move_window_bits( hwnd, &new_rects->visible, &new_rects->visible, &new_rects->window, valid_rects ); else - { - rects[0] = map_dpi_rect( valid_rects[0], get_thread_dpi(), monitor_dpi ); - rects[1] = map_dpi_rect( valid_rects[1], get_thread_dpi(), monitor_dpi ); - user_driver->pMoveWindowBits( hwnd, &monitor_rects, rects ); - } + user_driver->pMoveWindowBits( hwnd, &old_rects, new_rects, valid_rects ); }
user_driver->pWindowPosChanged( hwnd, insert_after, swp_flags, &monitor_rects, get_driver_window_surface( new_surface, monitor_dpi ) ); diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 16dad0747a2..5faf3357625 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -2524,30 +2524,28 @@ BOOL X11DRV_WindowPosChanging( HWND hwnd, UINT swp_flags, BOOL shaped, const str /*********************************************************************** * MoveWindowBits (X11DRV.@) */ -void X11DRV_MoveWindowBits( HWND hwnd, const struct window_rects *new_rects, const RECT *valid_rects ) +void X11DRV_MoveWindowBits( HWND hwnd, const struct window_rects *old_rects, + const struct window_rects *new_rects, const RECT *valid_rects ) { - RECT old_visible_rect, old_client_rect; struct x11drv_win_data *data; Window window;
if (!(data = get_win_data( hwnd ))) return; - old_visible_rect = data->rects.visible; - old_client_rect = data->rects.client; window = data->whole_window; release_win_data( data );
/* if all that happened is that the whole window moved, copy everything */ - if (EqualRect( &valid_rects[0], &new_rects->visible ) && EqualRect( &valid_rects[1], &old_visible_rect )) + if (EqualRect( &valid_rects[0], &new_rects->visible ) && EqualRect( &valid_rects[1], &old_rects->visible )) { /* 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_visible_rect, &new_rects->visible, - &old_client_rect, &new_rects->client, &new_rects->window ); + move_window_bits( hwnd, 0, &old_rects->visible, &new_rects->visible, + &old_rects->client, &new_rects->client, &new_rects->window ); } else { move_window_bits( hwnd, window, &valid_rects[1], &valid_rects[0], - &old_client_rect, &new_rects->client, &new_rects->window ); + &old_rects->client, &new_rects->client, &new_rects->window ); } }
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index a207db1c4a1..bb4c9caeb43 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -246,7 +246,8 @@ extern LRESULT X11DRV_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) extern BOOL X11DRV_WindowPosChanging( HWND hwnd, UINT swp_flags, BOOL shaped, const struct window_rects *rects ); extern BOOL X11DRV_GetWindowStyleMasks( HWND hwnd, UINT style, UINT ex_style, UINT *style_mask, UINT *ex_style_mask ); extern BOOL X11DRV_CreateWindowSurface( HWND hwnd, BOOL layered, const RECT *surface_rect, struct window_surface **surface ); -extern void X11DRV_MoveWindowBits( HWND hwnd, const struct window_rects *new_rects, const RECT *valid_rects ); +extern void X11DRV_MoveWindowBits( HWND hwnd, const struct window_rects *old_rects, + const struct window_rects *new_rects, const RECT *valid_rects ); extern void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags, const struct window_rects *new_rects, struct window_surface *surface ); extern BOOL X11DRV_SystemParametersInfo( UINT action, UINT int_param, void *ptr_param, diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h index fee065af71b..78f7718b106 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -388,7 +388,7 @@ struct user_driver_funcs BOOL (*pWindowPosChanging)(HWND,UINT,BOOL,const struct window_rects *); BOOL (*pGetWindowStyleMasks)(HWND,UINT,UINT,UINT*,UINT*); BOOL (*pCreateWindowSurface)(HWND,BOOL,const RECT *,struct window_surface**); - void (*pMoveWindowBits)(HWND,const struct window_rects *,const RECT *); + void (*pMoveWindowBits)(HWND,const struct window_rects *,const struct window_rects *,const RECT *); void (*pWindowPosChanged)(HWND,HWND,UINT,const struct window_rects*,struct window_surface*); /* system parameters */ BOOL (*pSystemParametersInfo)(UINT,UINT,void*,UINT);