Skip to content

Commit

Permalink
prevent window resizing when toggling fullscreen (#391)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamiras authored Dec 16, 2023
1 parent a804a2f commit 7f083d3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2165,14 +2165,15 @@ void Application::resizeWindow(int width, int height)
void Application::toggleFullscreen()
{
Uint32 fullscreen = SDL_GetWindowFlags(_window) & SDL_WINDOW_FULLSCREEN_DESKTOP;
SDL_SetWindowFullscreen(_window, fullscreen ^ SDL_WINDOW_FULLSCREEN_DESKTOP);

if (fullscreen)
{
SetMenu(g_mainWindow, _menu);
SDL_ShowCursor(SDL_ENABLE);
}
else

SDL_SetWindowFullscreen(_window, fullscreen ^ SDL_WINDOW_FULLSCREEN_DESKTOP);

if (!fullscreen)
{
SetMenu(g_mainWindow, NULL);
SDL_ShowCursor(SDL_DISABLE);
Expand Down

0 comments on commit 7f083d3

Please sign in to comment.