Rebase against 330dc601978922aa1d5864d29d94882d6b1990d1.

This commit is contained in:
Alistair Leslie-Hughes
2022-03-12 11:27:46 +11:00
parent 0e1d830578
commit f077cbe2d3
28 changed files with 467 additions and 458 deletions

View File

@@ -1,4 +1,4 @@
From f71bf1dbfced899bffb9f5baf0015f82779f81b8 Mon Sep 17 00:00:00 2001
From 93abf7b468f93d525ef47754737496a11facaec4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gabriel=20Iv=C4=83ncescu?= <gabrielopcode@gmail.com>
Date: Wed, 16 Sep 2020 17:35:09 +0300
Subject: [PATCH] user32: Fix messages sent on a window without WS_CHILD, but
@@ -22,10 +22,10 @@ Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index d61c813b492..92076573b90 100644
index c6f2bc38c6c..9164f57fdc2 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -16796,6 +16796,7 @@ static const struct message WmSetParentSeq_2[] = {
@@ -17117,6 +17117,7 @@ static const struct message WmSetParentSeq_2[] = {
{ HCBT_ACTIVATE, hook|optional },
{ EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam|optional, 0, 0 },
{ WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE },
@@ -33,7 +33,7 @@ index d61c813b492..92076573b90 100644
{ WM_NCACTIVATE, sent|wparam|optional, 1 },
{ WM_ACTIVATE, sent|wparam|optional, 1 },
{ HCBT_SETFOCUS, hook|optional },
@@ -16866,7 +16867,7 @@ static void test_SetParent(void)
@@ -17187,7 +17188,7 @@ static void test_SetParent(void)
SetParent(popup, child);
flush_events();
@@ -43,34 +43,34 @@ index d61c813b492..92076573b90 100644
ok(GetWindowLongA(popup, GWL_STYLE) & WS_VISIBLE, "WS_VISIBLE should be set\n");
ok(!IsWindowVisible(popup), "IsWindowVisible() should return FALSE\n");
diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c
index fa2f7e6fede..5d9401f13a4 100644
index 3238d0c1b50..b0a4fac958a 100644
--- a/dlls/user32/winpos.c
+++ b/dlls/user32/winpos.c
@@ -1144,8 +1144,8 @@ static BOOL show_window( HWND hwnd, INT cmd )
@@ -1029,8 +1029,8 @@ static BOOL show_window( HWND hwnd, INT cmd )
}
swp = new_swp;
- parent = GetAncestor( hwnd, GA_PARENT );
- parent = NtUserGetAncestor( hwnd, GA_PARENT );
- if (parent && !IsWindowVisible( parent ) && !(swp & SWP_STATECHANGED))
+ if ((style & WS_CHILD) && (parent = GetAncestor( hwnd, GA_PARENT )) &&
+ if ((style & WS_CHILD) && (parent = NtUserGetAncestor( hwnd, GA_PARENT )) &&
+ !IsWindowVisible( parent ) && !(swp & SWP_STATECHANGED))
{
/* if parent is not visible simply toggle WS_VISIBLE and return */
if (showFlag) WIN_SetStyle( hwnd, WS_VISIBLE, 0 );
@@ -2042,8 +2042,11 @@ static BOOL fixup_flags( WINDOWPOS *winpos, const RECT *old_window_rect, int par
@@ -1849,8 +1849,11 @@ static BOOL fixup_flags( WINDOWPOS *winpos, const RECT *old_window_rect, int par
if (winpos->cy < 0) winpos->cy = 0;
else if (winpos->cy > 32767) winpos->cy = 32767;
- parent = GetAncestor( winpos->hwnd, GA_PARENT );
- parent = NtUserGetAncestor( winpos->hwnd, GA_PARENT );
- if (!IsWindowVisible( parent )) winpos->flags |= SWP_NOREDRAW;
+ if (wndPtr->dwStyle & WS_CHILD)
+ {
+ parent = GetAncestor( winpos->hwnd, GA_PARENT );
+ parent = NtUserGetAncestor( winpos->hwnd, GA_PARENT );
+ if (!IsWindowVisible( parent )) winpos->flags |= SWP_NOREDRAW;
+ }
if (wndPtr->dwStyle & WS_VISIBLE) winpos->flags &= ~SWP_SHOWWINDOW;
else
--
2.33.0
2.35.1