Skip to content

Commit

Permalink
Fixed restoring window size when coming out of fullscreen desktop mode.
Browse files Browse the repository at this point in the history
Use the style of the window as it will be, not as it currently is at the
time of the AdjustWindowRect call.
  • Loading branch information
slouken committed Oct 7, 2017
1 parent e9652b1 commit 1bfe6d6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/video/windows/SDL_windowswindow.c
Expand Up @@ -595,6 +595,8 @@ WIN_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display,
style &= ~WS_MAXIMIZE;
}
} else {
BOOL menu;

/* Restore window-maximization state, as applicable.
Special care is taken to *not* do this if and when we're
alt-tab'ing away (to some other window; as indicated by
Expand All @@ -606,7 +608,8 @@ WIN_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display,
data->windowed_mode_was_maximized = SDL_FALSE;
}

WIN_AdjustWindowRect(window, &x, &y, &w, &h, SDL_FALSE);
menu = (style & WS_CHILDWINDOW) ? FALSE : (GetMenu(hwnd) != NULL);
WIN_AdjustWindowRectWithStyle(window, style, menu, &x, &y, &w, &h, SDL_FALSE);
}
SetWindowLong(hwnd, GWL_STYLE, style);
data->expected_resize = SDL_TRUE;
Expand Down

0 comments on commit 1bfe6d6

Please sign in to comment.