From: Giovanni Mascellani gmascellani@codeweavers.com
Signed-off-by: Giovanni Mascellani gmascellani@codeweavers.com --- dlls/user32/tests/win.c | 6 ++---- dlls/win32u/window.c | 11 +++++++++++ 2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index e544828c702..7df271d3c79 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -8911,10 +8911,8 @@ static LRESULT WINAPI message_window_topmost_proc(HWND hwnd, UINT msg, WPARAM wp * between sensibility and specificity, WM_KILLFOCUS is always * considered bad, while all the other messages are considered * bad only on the message-only widow. */ - todo_wine_if(msg == WM_KILLFOCUS) ok(msg != WM_KILLFOCUS, "Received message WM_KILLFOCUS for window %p (message-only window is %p)\n", hwnd, message_window_topmost_hwnd_msg); - todo_wine_if(hwnd == message_window_topmost_hwnd_msg) ok(hwnd != message_window_topmost_hwnd_msg, "Received message %u for message-only window %p\n", msg, hwnd); } @@ -9003,7 +9001,7 @@ static void test_message_window_topmost(void) ret = EndDeferWindowPos(hdwp); ok(ret, "Unexpected failure when calling EndDeferWindowPos()\n");
- todo_wine ok(GetLastError() == 0xdeadbeef, "Last error unexpectedly set to %#lx\n", GetLastError()); + ok(GetLastError() == 0xdeadbeef, "Last error unexpectedly set to %#lx\n", GetLastError());
while (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE)) { @@ -9015,7 +9013,7 @@ static void test_message_window_topmost(void)
ret = GetWindowRect(hwnd_msg, &rect); ok(ret, "Unexpected failure when calling GetWindowRect()\n"); - todo_wine ok(rect.left == 220 && rect.top == 221 && rect.right == 220 + 222 && rect.bottom == 221 + 223, + ok(rect.left == 220 && rect.top == 221 && rect.right == 220 + 222 && rect.bottom == 221 + 223, "Unexpected rectangle %s\n", wine_dbgstr_rect(&rect));
message_window_topmost_received_killfocus = FALSE; diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index 506af7530d3..01c01bc5b73 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -3366,6 +3366,17 @@ BOOL set_window_pos( WINDOWPOS *winpos, int parent_x, int parent_y ) BOOL ret = FALSE; DPI_AWARENESS_CONTEXT context;
+ if (!(winpos->flags & SWP_NOZORDER) + && (winpos->hwndInsertAfter == HWND_TOPMOST || winpos->hwndInsertAfter == HWND_NOTOPMOST)) + { + HWND root; + + root = NtUserGetAncestor(winpos->hwnd, GA_ROOT); + root = NtUserGetAncestor(root, GA_PARENT); + if (root == get_hwnd_message_parent()) + return TRUE; + } + orig_flags = winpos->flags;
/* First, check z-order arguments. */