Zhiyi Zhang zzhang@codeweavers.com wrote:
@@ -1266,6 +1266,8 @@ static void handle_wm_state_notify( HWND hwnd, XPropertyEvent *event, BOOL updat { TRACE( "restoring win %p/%lx\n", data->hwnd, data->whole_window ); release_win_data( data );
if ((style & (WS_MINIMIZE | WS_VISIBLE)) == (WS_MINIMIZE | WS_VISIBLE))
SetActiveWindow( hwnd ); SendMessageW( hwnd, WM_SYSCOMMAND, SC_RESTORE, 0 ); return; }
Your test doesn't contain the code to check the (WS_MINIMIZE | WS_VISIBLE) statement, I'd guess a not visible window won't receive an activation event before window pos messages, but that should be verified with a test that calls ShowWindow(SW_RESTORE) instead of Alt-tabbing. Also from your test it looks like that it's the Explorer who actually activates the window before restoring it, probably you should add similar code to programs/explorer/systray.c to make your app work also in desktop mode.
ShowWindow(SW_RESTORE) with invisible minimized window is already tested in user32/tests/msg.c#L5135 with WmShowRestoreMinOverlappedSeq message sequence.
I see, thanks. However there is no an existing sequence for calling DefWindowProc(WM_SYSCOMMAND, SC_RESTORE) for a minimized visible window to compare it with, so that it could be more clear when and how the window gets activated. Could you please add it as well?