[PATCH v2 1/2] winex11.drv: Activate window when restoring from iconic state.

Dmitry Timoshkov dmitry at baikal.ru
Fri May 24 04:33:36 CDT 2019


Zhiyi Zhang <zzhang at codeweavers.com> wrote:

> #2 The reason why Mirror's Edge doesn't handle WM_SYSCOMMAND SC_RESTORE
> 
> Disassembly of the game win proc shows that the win proc return 0 directly
> when handling WM_SYSCOMMAND SC_RESTORE in fullscreen mode, instead of
> handing it to DefWindowProc or do any sort of processing. So this means
> it rely on the WM_ACTIVATE message before WM_SYSCOMMAND.

It should be possible to add a message test that replicates this behaviour.

> @@ -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;

According to your spy++ logs activating a minimized window before sending
WM_SYSCOMMAND/SC_RESTORE is the result of a SetWindowPos call. A message
test should help to figure it out its exact flags, in any case it's wrong
to call SetActiveWindow directly.

-- 
Dmitry.



More information about the wine-devel mailing list