Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: [Win32] Fullscreen OpenTTD cannot be alt-tabbed back into #8792

Merged
merged 2 commits into from
Mar 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/video/win32_v.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ bool VideoDriver_Win32Base::MakeWindow(bool full_screen)
_fullscreen = full_screen;

/* recreate window? */
if ((full_screen || this->fullscreen) && this->main_wnd) {
if ((full_screen != this->fullscreen) && this->main_wnd) {
DestroyWindow(this->main_wnd);
this->main_wnd = 0;
}
Expand Down Expand Up @@ -715,7 +715,9 @@ LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
if (video_driver->fullscreen) {
if (active && minimized) {
/* Restore the game window */
Dimension d = _bck_resolution; // Save current non-fullscreen window size as it will be overwritten by ShowWindow.
ShowWindow(hwnd, SW_RESTORE);
_bck_resolution = d;
video_driver->MakeWindow(true);
} else if (!active && !minimized) {
/* Minimise the window and restore desktop */
Expand Down