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, 12 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 599bcf17c40..c12e02c28f8 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -8981,7 +8981,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)) { @@ -8989,7 +8989,7 @@ static void test_message_window_topmost(void) DispatchMessageW(&msg); }
- todo_wine ok(!message_window_topmost_event_delivered, "Unexpected event was delivered\n"); + ok(!message_window_topmost_event_delivered, "Unexpected event was delivered\n");
ok(DestroyWindow(hwnd_msg), "Cannot destroy main window\n"); ok(DestroyWindow(hwnd), "Cannot destroy message window\n"); 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. */