diff --git a/CHANGES b/CHANGES index 2636a6ed8..c8925d418 100644 --- a/CHANGES +++ b/CHANGES @@ -25,6 +25,7 @@ Other fixes: - Qt: Fix Battle Chip view not displaying chips on some DPI settings - Qt: Fix camera image being upside-down sometimes (fixes mgba.io/i/829 again) - Qt: Fix drawing on macOS break when using OpenGL (fixes mgba.io/i/1899) + - Qt: Fix stride changing when toggling SGB borders (fixes mgba.io/i/1898) - mGUI: Fix closing down a game if an exit is signalled - mVL: Fix injecting accidentally draining non-injection buffer - VFS: Fix directory node listing on some filesystems diff --git a/src/platform/qt/CoreController.cpp b/src/platform/qt/CoreController.cpp index 3f1886de5..bc79031e3 100644 --- a/src/platform/qt/CoreController.cpp +++ b/src/platform/qt/CoreController.cpp @@ -265,11 +265,23 @@ void CoreController::loadConfig(ConfigController* config) { m_fastForwardMute = config->getOption("fastForwardMute", -1).toInt(); mCoreConfigCopyValue(&m_threadContext.core->config, config->config(), "volume"); mCoreConfigCopyValue(&m_threadContext.core->config, config->config(), "mute"); + + QSize sizeBefore = screenDimensions(); mCoreLoadForeignConfig(m_threadContext.core, config->config()); + QSize sizeAfter = screenDimensions(); if (hasStarted()) { updateFastForward(); mCoreThreadRewindParamsChanged(&m_threadContext); } + if (sizeBefore != sizeAfter) { + m_threadContext.core->setVideoBuffer(m_threadContext.core, reinterpret_cast(m_activeBuffer.data()), sizeAfter.width()); +#ifdef M_CORE_GB + mCoreConfigSetIntValue(&m_threadContext.core->config, "sgb.borders", 0); + m_threadContext.core->reloadConfigOption(m_threadContext.core, "sgb.borders", nullptr); + mCoreConfigCopyValue(&m_threadContext.core->config, config->config(), "sgb.borders"); + m_threadContext.core->reloadConfigOption(m_threadContext.core, "sgb.borders", nullptr); +#endif + } } #ifdef USE_DEBUGGERS