Fixed logic issue so that the main window size is not saved if the screen is in full or maximize modes. Only save previous screen size to config if in normal window mode. This prevents the next start of fceux setting the initial window size to close to maximum.

This commit is contained in:
mjbudd77 2021-06-04 20:53:11 -04:00
parent c808d1f2d0
commit b1b9b50f7b
2 changed files with 22 additions and 10 deletions

View File

@ -935,6 +935,12 @@ void ConsoleVideoConfDialog_t::applyChanges( void )
yscale = yScaleBox->value();
}
// Save desired scaling and window size to config.
g_config->setOption("SDL.XScale", xscale );
g_config->setOption("SDL.YScale", yscale );
g_config->setOption("SDL.WinSizeX", s.width() );
g_config->setOption("SDL.WinSizeY", s.height() );
if ( consoleWindow->viewport_GL )
{
consoleWindow->viewport_GL->setLinearFilterEnable( gl_LF_chkBox->isChecked() );

View File

@ -231,18 +231,24 @@ consoleWin_t::~consoleWin_t(void)
// Save window size and image scaling parameters at app exit.
w = consoleWindow->size();
if ( viewport_GL != NULL )
// Only Save window size if not fullscreen and not maximized
if ( !consoleWindow->isFullScreen() && !consoleWindow->isMaximized() )
{
g_config->setOption( "SDL.XScale", viewport_GL->getScaleX() );
g_config->setOption( "SDL.YScale", viewport_GL->getScaleY() );
// Scaling is only saved when applying video settings
//if ( viewport_GL != NULL )
//{
// g_config->setOption( "SDL.XScale", viewport_GL->getScaleX() );
// g_config->setOption( "SDL.YScale", viewport_GL->getScaleY() );
//}
//else if ( viewport_SDL != NULL )
//{
// g_config->setOption( "SDL.XScale", viewport_SDL->getScaleX() );
// g_config->setOption( "SDL.YScale", viewport_SDL->getScaleY() );
//}
g_config->setOption( "SDL.WinSizeX", w.width() );
g_config->setOption( "SDL.WinSizeY", w.height() );
}
else if ( viewport_SDL != NULL )
{
g_config->setOption( "SDL.XScale", viewport_SDL->getScaleX() );
g_config->setOption( "SDL.YScale", viewport_SDL->getScaleY() );
}
g_config->setOption( "SDL.WinSizeX", w.width() );
g_config->setOption( "SDL.WinSizeY", w.height() );
g_config->save();
// Signal Emulator Thread to Stop