From: Giovanni Mascellani gmascellani@codeweavers.com
Signed-off-by: Giovanni Mascellani gmascellani@codeweavers.com --- dlls/user32/tests/win.c | 2 +- dlls/win32u/window.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 8183bfd3eeb..0fd052c16ff 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -8966,7 +8966,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. */