From 01706f306c74b0cb5f4041476f4723ecea633ea7 Mon Sep 17 00:00:00 2001 From: Qrox Date: Fri, 17 Jan 2020 14:01:36 +0800 Subject: [PATCH] Recalculate terminal size when maximizing the game window --- src/sdltiles.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sdltiles.cpp b/src/sdltiles.cpp index ef275e435b215..5845d568e43e4 100644 --- a/src/sdltiles.cpp +++ b/src/sdltiles.cpp @@ -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; @@ -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 ); }