Zebediah Figura : user32: SetWindowPos() shouldn' t change the client rect of a minimized window.
Alexandre Julliard
julliard at winehq.org
Tue Feb 19 15:29:34 CST 2019
Module: wine
Branch: master
Commit: 119e215e3ea7ff4396245f70a9fa3322625a3c99
URL: https://source.winehq.org/git/wine.git/?a=commit;h=119e215e3ea7ff4396245f70a9fa3322625a3c99
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Tue Feb 19 12:17:36 2019 -0600
user32: SetWindowPos() shouldn't change the client rect of a minimized window.
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/user32/tests/win.c | 12 ++++++++++++
dlls/user32/winpos.c | 2 +-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c
index 50dbf49..ceb4b82 100644
--- a/dlls/user32/tests/win.c
+++ b/dlls/user32/tests/win.c
@@ -6550,6 +6550,18 @@ static void test_ShowWindow(void)
todo_wine
ok(EqualRect(&rcEmpty, &rc), "expected %s, got %s\n",
wine_dbgstr_rect(&rcEmpty), wine_dbgstr_rect(&rc));
+ /* SetWindowPos shouldn't affect the client rect */
+ ret = SetWindowPos(hwnd, 0, 0, 0, 0, 0,
+ SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER);
+ ok(ret, "not expected ret: %lu\n", ret);
+ GetWindowRect(hwnd, &rc);
+ todo_wine
+ ok(EqualRect(&rcMinimized, &rc), "expected %s, got %s\n",
+ wine_dbgstr_rect(&rcMinimized), wine_dbgstr_rect(&rc));
+ GetClientRect(hwnd, &rc);
+ todo_wine
+ ok(EqualRect(&rcEmpty, &rc), "expected %s, got %s\n",
+ wine_dbgstr_rect(&rcEmpty), wine_dbgstr_rect(&rc));
ShowWindow(hwnd, SW_RESTORE);
ok(ret, "not expected ret: %lu\n", ret);
diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c
index 4b39d0a..38444b2 100644
--- a/dlls/user32/winpos.c
+++ b/dlls/user32/winpos.c
@@ -1699,7 +1699,7 @@ static BOOL SWP_DoWinPosChanging( WINDOWPOS *pWinpos, RECT *old_window_rect, REC
WIN_GetRectangles( pWinpos->hwnd, COORDS_PARENT, old_window_rect, old_client_rect );
*new_window_rect = *old_window_rect;
- *new_client_rect = (wndPtr->dwStyle & WS_MINIMIZE) ? *old_window_rect : *old_client_rect;
+ *new_client_rect = *old_client_rect;
if (!(pWinpos->flags & SWP_NOSIZE))
{
More information about the wine-cvs
mailing list