From: Giovanni Mascellani gmascellani@codeweavers.com
Signed-off-by: Giovanni Mascellani gmascellani@codeweavers.com --- dlls/user32/tests/win.c | 4 ++-- dlls/win32u/window.c | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index ed3ec88043e..b2362d3922e 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -8902,8 +8902,8 @@ static BOOL message_window_topmost_destroying = FALSE;
static LRESULT WINAPI message_window_topmost_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { - if (msg == WM_KILLFOCUS && !message_window_topmost_destroying) - todo_wine ok(msg != WM_KILLFOCUS, "WM_KILLFOCUS message was delivered\n"); + if (!message_window_topmost_destroying) + ok(msg != WM_KILLFOCUS, "WM_KILLFOCUS message was delivered\n");
return DefWindowProcW(hwnd, msg, wparam, lparam); } diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index e7ccbf7a928..ba73ee4a528 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -3490,6 +3490,7 @@ done: BOOL WINAPI NtUserSetWindowPos( HWND hwnd, HWND after, INT x, INT y, INT cx, INT cy, UINT flags ) { WINDOWPOS winpos; + HWND root;
TRACE( "hwnd %p, after %p, %d,%d (%dx%d), flags %08x\n", hwnd, after, x, y, cx, cy, flags ); if(TRACE_ON(win)) dump_winpos_flags(flags); @@ -3500,6 +3501,11 @@ BOOL WINAPI NtUserSetWindowPos( HWND hwnd, HWND after, INT x, INT y, INT cx, INT return FALSE; }
+ root = NtUserGetAncestor(hwnd, GA_ROOT); + root = NtUserGetAncestor(root, GA_PARENT); + if (root == get_hwnd_message_parent()) + return TRUE; + winpos.hwnd = get_full_window_handle( hwnd ); winpos.hwndInsertAfter = get_full_window_handle( after ); winpos.x = x;