From 36c66e7db434bc3034ec172323cc7f0cd7e5c1ec Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sat, 22 Apr 2017 18:29:10 -0700 Subject: [PATCH] Qt: Fix logo missing with integer scaling (fixes #696) --- src/platform/qt/Window.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/platform/qt/Window.cpp b/src/platform/qt/Window.cpp index 1588df0eb..112ee95bf 100644 --- a/src/platform/qt/Window.cpp +++ b/src/platform/qt/Window.cpp @@ -135,6 +135,7 @@ Window::Window(ConfigController* config, int playerId, QWidget* parent) #endif m_screenWidget->setPixmap(m_logo); m_screenWidget->setLockAspectRatio(m_logo.width(), m_logo.height()); + m_screenWidget->setLockIntegerScaling(false); setCentralWidget(m_screenWidget); connect(m_controller, SIGNAL(gameStarted(mCoreThread*, const QString&)), this, SLOT(gameStarted(mCoreThread*, const QString&))); @@ -732,6 +733,7 @@ void Window::gameStarted(mCoreThread* context, const QString& fname) { context->core->desiredVideoDimensions(context->core, &width, &height); m_display->setMinimumSize(width, height); m_screenWidget->setMinimumSize(m_display->minimumSize()); + m_config->updateOption("lockIntegerScaling"); if (m_savedScale > 0) { resizeFrame(QSize(width, height) * m_savedScale); } @@ -794,6 +796,7 @@ void Window::gameStopped() { updateTitle(); detachWidget(m_display); m_screenWidget->setLockAspectRatio(m_logo.width(), m_logo.height()); + m_screenWidget->setLockIntegerScaling(false); m_screenWidget->setPixmap(m_logo); m_screenWidget->unsetCursor(); #ifdef M_CORE_GB @@ -1267,7 +1270,9 @@ void Window::setupMenu(QMenuBar* menubar) { lockIntegerScaling->addBoolean(tr("Force integer scaling"), avMenu); lockIntegerScaling->connect([this](const QVariant& value) { m_display->lockIntegerScaling(value.toBool()); - m_screenWidget->setLockIntegerScaling(value.toBool()); + if (m_controller->isLoaded()) { + m_screenWidget->setLockIntegerScaling(value.toBool()); + } }, this); m_config->updateOption("lockIntegerScaling");