Fix restoring window size when exiting fullscreen #3400
There were two different issues:
The first issue might be specific to macOS, for which fullscreen more or less means maximized, and in particular when requesting a
That issue only occurred if maximized size was stored in the config file (i.e. if the window had been maximized by the user at least once in the past).
The second issue was more general. In
As the SDL behaviour may be different on other systems, it would be good to test that this works as expected on other systems (e.g. Windows and Linux) before merging this change.
Note: On macOS setting the
The text was updated successfully, but these errors were encountered:
… fullscreen When loadVideoMode gets called to exit fullscreen, the window is still fullscreen, which means that the SDL_WINDOW_MAXIMIZED is set (at least on macOS). As a result the window was resized to the stored maximized window size instead of the size it had before entering fullscreen.
When entering fullscreen it was storing the default window size in the config, which was overwriting the current window size. As a result when exiting window size, instead of restoring to the previous window size it was restoring to the default window size.