From: Giovanni Mascellani gmascellani@codeweavers.com
Signed-off-by: Giovanni Mascellani gmascellani@codeweavers.com --- dlls/user32/tests/win.c | 4 +--- dlls/win32u/window.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 2f0a2b5ffb3..afc4ce71b55 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -8910,10 +8910,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); } @@ -8972,7 +8970,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)) { diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index fee1617ef10..559693f83a4 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -3366,6 +3366,16 @@ BOOL set_window_pos( WINDOWPOS *winpos, int parent_x, int parent_y ) BOOL ret = FALSE; DPI_AWARENESS_CONTEXT context;
+ if (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. */