Skip to content

Commit

Permalink
Merge pull request #37175 from Qrox/fix-maximize-resize
Browse files Browse the repository at this point in the history
Fix terminal size calculation with maximize window option
  • Loading branch information
ZhilkinSerg authored Jan 19, 2020
2 parents f39eef2 + 01706f3 commit 764b9fa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/sdltiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,8 @@ static void WinCreate()
// On Android SDL seems janky in windowed mode so we're fullscreen all the time.
// Fullscreen mode is now modified so it obeys terminal width/height, rather than
// overwriting it with this calculation.
if( window_flags & SDL_WINDOW_FULLSCREEN || window_flags & SDL_WINDOW_FULLSCREEN_DESKTOP ) {
if( window_flags & SDL_WINDOW_FULLSCREEN || window_flags & SDL_WINDOW_FULLSCREEN_DESKTOP
|| window_flags & SDL_WINDOW_MAXIMIZED ) {
SDL_GetWindowSize( ::window.get(), &WindowWidth, &WindowHeight );
// Ignore previous values, use the whole window, but nothing more.
TERMINAL_WIDTH = WindowWidth / fontwidth / scaling_factor;
Expand Down Expand Up @@ -502,7 +503,8 @@ static void WinCreate()

#if defined(__ANDROID__)
// TODO: Not too sure why this works to make fullscreen on Android behave. :/
if( window_flags & SDL_WINDOW_FULLSCREEN || window_flags & SDL_WINDOW_FULLSCREEN_DESKTOP ) {
if( window_flags & SDL_WINDOW_FULLSCREEN || window_flags & SDL_WINDOW_FULLSCREEN_DESKTOP
|| window_flags & SDL_WINDOW_MAXIMIZED ) {
SDL_GetWindowSize( ::window.get(), &WindowWidth, &WindowHeight );
}

Expand Down

0 comments on commit 764b9fa

Please sign in to comment.