[PATCH 3/5] user32/tests: Add optional message to fix ShowWindow test.

Connor McAdams cmcadams at codeweavers.com
Mon Sep 13 14:53:49 CDT 2021


On Fri, Sep 10, 2021 at 01:06:38PM -0400, Connor McAdams wrote:
> Windows 7 sometimes sends an optional WM_WINDOWPOSCHANGED message along
> with the optional WM_WINDOWPOSCHANGING message.
> 
> Signed-off-by: Connor McAdams <cmcadams at codeweavers.com>
> ---
>  dlls/user32/tests/msg.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
> index 9133d76554c..d480b903e1f 100644
> --- a/dlls/user32/tests/msg.c
> +++ b/dlls/user32/tests/msg.c
> @@ -13462,7 +13462,8 @@ static const struct message WmMinimize_3[] = {
>      { WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED, 0, SWP_NOACTIVATE },
>      { HCBT_ACTIVATE, hook|optional },
>      { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE },
> -    { WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED, 0, SWP_NOACTIVATE },
> +    { WM_WINDOWPOSCHANGED, sent|optional },
> +    { WM_WINDOWPOSCHANGED, sent|optional },
>      { WM_MOVE, sent|defwinproc },
>      { WM_SIZE, sent|wparam|lparam|defwinproc, SIZE_MINIMIZED, 0 },
>      { 0 }
> -- 
> 2.25.1
>

Some context behind this change:

Windows 7 seems to occasionally send a WM_WINDOWPOSCHANGED prior to the
one currently in the sequence. Problem is, its flags are 
SWP_NOSIZE|SWP_NOMOVE|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE which aren't the
same as the flags of the message currently in the sequence. Even if we set
this new WM_WINDOWPOSCHANGED message to optional in the sequence, it'll
still try to test the flags, which in the circumstance where the optional 
message isn't sent, results in a test failure. The only sane way to do this
seems to be to stop checking for flags on either message in the sequence.



More information about the wine-devel mailing list