Update the window size when using maximise on macOS

This commit is contained in:
Marco Benzi Tobar 2017-04-07 12:09:11 -03:00 committed by Michael Steenbeek
parent 08ccdd6bf0
commit 67b4d919b4
6 changed files with 22 additions and 3 deletions

View File

@ -75,6 +75,7 @@ Includes all git commit authors. Aliases are GitHub user names.
* Daniel Trujillo Viedma (gDanix)
* Jonathan Haas (HaasJona)
* Jake Breen (Haekb)
* Marco Benzi Tobar (Lisergishnu)
## Toolchain
* (Balletie) - macOS

View File

@ -569,4 +569,9 @@ bool platform_get_font_path(TTFFontDescriptor *font, utf8 *buffer, size_t size)
}
#endif // NO_TTF
sint32 platform_get_non_window_flags()
{
return SDL_WINDOW_MAXIMIZED | SDL_WINDOW_MINIMIZED | SDL_WINDOW_FULLSCREEN | SDL_WINDOW_FULLSCREEN_DESKTOP;
}
#endif

View File

@ -279,4 +279,9 @@ uint8 platform_get_locale_measurement_format()
}
}
sint32 platform_get_non_window_flags()
{
return SDL_WINDOW_MINIMIZED | SDL_WINDOW_FULLSCREEN | SDL_WINDOW_FULLSCREEN_DESKTOP;
}
#endif

View File

@ -239,4 +239,9 @@ void core_init();
void macos_disallow_automatic_window_tabbing();
#endif
// On macOS the resizing behaviour effectively resizes the window in the same
// way a normal drag would do, given constraints in the user desktop (e.g. the dock
// positioning). So it follows that the finished window size should be saved.
sint32 platform_get_non_window_flags();
#endif

View File

@ -194,9 +194,7 @@ static void platform_resize(sint32 width, sint32 height)
// Check if the window has been resized in windowed mode and update the config file accordingly
// This is called in rct2_update and is only called after resizing a window has finished
const sint32 nonWindowFlags =
SDL_WINDOW_MAXIMIZED | SDL_WINDOW_MINIMIZED | SDL_WINDOW_FULLSCREEN | SDL_WINDOW_FULLSCREEN_DESKTOP;
if (!(flags & nonWindowFlags)) {
if (!(flags & platform_get_non_window_flags())) {
if (width != gConfigGeneral.window_width || height != gConfigGeneral.window_height) {
gConfigGeneral.window_width = width;
gConfigGeneral.window_height = height;

View File

@ -1237,4 +1237,9 @@ bool platform_setup_uri_protocol()
///////////////////////////////////////////////////////////////////////////////
sint32 platform_get_non_window_flags()
{
return SDL_WINDOW_MAXIMIZED | SDL_WINDOW_MINIMIZED | SDL_WINDOW_FULLSCREEN | SDL_WINDOW_FULLSCREEN_DESKTOP;
}
#endif