Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/user32/driver.c | 2 +- dlls/user32/winpos.c | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/driver.c b/dlls/user32/driver.c index 1c3b62eff2b..35e206f5e98 100644 --- a/dlls/user32/driver.c +++ b/dlls/user32/driver.c @@ -356,7 +356,7 @@ static void CDECL nulldrv_SetWindowText( HWND hwnd, LPCWSTR text )
static UINT CDECL nulldrv_ShowWindow( HWND hwnd, INT cmd, RECT *rect, UINT swp ) { - return swp; + return ~0; /* use default implementation */ }
static LRESULT CDECL nulldrv_SysCommand( HWND hwnd, WPARAM wparam, LPARAM lparam ) diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c index cf7e7914869..de5d50d4c3a 100644 --- a/dlls/user32/winpos.c +++ b/dlls/user32/winpos.c @@ -1118,7 +1118,16 @@ static BOOL show_window( HWND hwnd, INT cmd ) }
if (IsRectEmpty( &newPos )) new_swp = swp; - else new_swp = USER_Driver->pShowWindow( hwnd, cmd, &newPos, swp ); + else if ((new_swp = USER_Driver->pShowWindow( hwnd, cmd, &newPos, swp )) == ~0) + { + if (GetWindowLongW( hwnd, GWL_STYLE ) & WS_CHILD) new_swp = swp; + else if (IsIconic( hwnd ) && (newPos.left != -32000 || newPos.top != -32000)) + { + OffsetRect( &newPos, -32000 - newPos.left, -32000 - newPos.top ); + new_swp = swp & ~(SWP_NOMOVE | SWP_NOCLIENTMOVE); + } + else new_swp = swp; + } swp = new_swp;
parent = GetAncestor( hwnd, GA_PARENT );