From: Rémi Bernon rbernon@codeweavers.com
It confuses SDL which automatically restores window when it is being activated, and changes display mode on fullscreen window restore.
The extra window restore will try to restore the window again to its normal rectangle, but this time translated to the new display mode, ending up with a larger than monitor window resize. This confuses SDL, which then decides to restore the native display mode. --- dlls/win32u/message.c | 5 ++--- dlls/winemac.drv/window.c | 1 - dlls/winex11.drv/window.c | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index ab94884fc0a..7da66fd1494 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -2232,14 +2232,13 @@ static LRESULT handle_internal_message( HWND hwnd, UINT msg, WPARAM wparam, LPAR window_rect = map_rect_raw_to_virt( window_rect, get_thread_dpi() );
if (foreground) NtUserSetForegroundWindow( foreground ); - switch (LOWORD(state_cmd)) + switch (state_cmd) { case SC_RESTORE: - if (HIWORD(state_cmd)) NtUserSetActiveWindow( hwnd ); NtUserSetInternalWindowPos( hwnd, SW_SHOW, &window_rect, NULL ); /* fallthrough */ default: - send_message( hwnd, WM_SYSCOMMAND, LOWORD(state_cmd), 0 ); + send_message( hwnd, WM_SYSCOMMAND, state_cmd, 0 ); break; case 0: if (!swp_flags) break; diff --git a/dlls/winemac.drv/window.c b/dlls/winemac.drv/window.c index c4fafb613de..eb9b4b46f9e 100644 --- a/dlls/winemac.drv/window.c +++ b/dlls/winemac.drv/window.c @@ -1879,7 +1879,6 @@ void macdrv_window_did_unminimize(HWND hwnd) { TRACE("restoring win %p/%p\n", hwnd, data->cocoa_window); release_win_data(data); - NtUserSetActiveWindow(hwnd); send_message(hwnd, WM_SYSCOMMAND, SC_RESTORE, 0); return; } diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 843d0f36118..db2920f35f4 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1631,9 +1631,8 @@ static UINT window_update_client_state( struct x11drv_win_data *data ) } else if (old_style & (WS_MINIMIZE | WS_MAXIMIZE)) { - BOOL activate = (old_style & (WS_MINIMIZE | WS_VISIBLE)) == (WS_MINIMIZE | WS_VISIBLE); TRACE( "restoring win %p/%lx\n", data->hwnd, data->whole_window ); - return MAKELONG(SC_RESTORE, activate); + return SC_RESTORE; } } if (!(old_style & WS_MINIMIZE) && (new_style & WS_MINIMIZE))