On 11/5/19 1:44 PM, Rémi Bernon wrote:
The first messages in the sequence are generated right away by the SW_MINIMIZE request, but the last ones are only a result of the native driver implementation of the window minimization and may take some time to be received, or may not be received at all.
The test spuriously succeeds in the case where the driver messages are not received and only the optional messages at the end of the sequence are missing.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com
Notes: The test actually passes on all the testbot runs I could start. It fails locally though -testing with fvwm in Xephyr- from time to time because the WM sometimes reacts fast enough.
I'm not sure if that's a specificity of the testbot WM configuration, it looks like minimizing windows there does not trigger anymore messages not matter how long we wait.
dlls/user32/tests/msg.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
I actually debugged this a while ago. The problem is that another window gets activated on focus loss, and the test actually accounts for this—it happens on Windows too—but we do so incorrectly, sending WM_CANCELMODE when we shouldn't. I sent a patch for it over a year ago, but it fell off the list:
https://www.winehq.org/pipermail/wine-devel/2018-January/121881.html
Unless you're talking about a different failure, in which case, please disregard.
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 477661ab623..d0de1c6d8bd 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -5101,6 +5101,7 @@ static void test_messages(void) LRESULT res; POINT pos; BOOL ret;
DWORD minimize_timeout;
flush_sequence();
@@ -5163,7 +5164,13 @@ static void test_messages(void)
ShowWindow(hwnd, SW_MINIMIZE); flush_events();
- ok_sequence(WmShowMinOverlappedSeq, "ShowWindow(SW_SHOWMINIMIZED):overlapped", TRUE);
/* Minimizing may take some time to complete or may not be supported
* at all and this spuriously failed because everything after the 16th
* message of the sequence is optional. */
minimize_timeout = GetTickCount() + 500;
while (sequence_cnt <= 16 && GetTickCount() < minimize_timeout) flush_events();
ok_sequence(WmShowMinOverlappedSeq, "ShowWindow(SW_SHOWMINIMIZED):overlapped", sequence_cnt > 16); flush_sequence();
if (GetWindowLongW( hwnd, GWL_STYLE ) & WS_MINIMIZE)