From 953de5246524499fbc22683d7d0ffc3c11c36a21 Mon Sep 17 00:00:00 2001 From: BearOso Date: Wed, 11 Oct 2023 10:44:31 -0500 Subject: [PATCH] Qt: Fix issues with input rate and vrr. --- qt/src/EmuApplication.cpp | 8 +++++++- qt/src/EmuMainWindow.cpp | 7 +++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/qt/src/EmuApplication.cpp b/qt/src/EmuApplication.cpp index a7cca90c..13849f6c 100644 --- a/qt/src/EmuApplication.cpp +++ b/qt/src/EmuApplication.cpp @@ -387,7 +387,7 @@ bool EmuApplication::isBound(EmuBinding b) void EmuApplication::updateSettings() { - if (config->adjust_input_rate_automatically) + if (config->adjust_input_rate_automatically && !config->vrr_enabled) { constexpr double ir_ratio = 60.098813 / 32040.0; @@ -399,6 +399,12 @@ void EmuApplication::updateSettings() config->input_rate /= 3; else if (refresh > 239 && refresh < 241) config->input_rate /= 4; + else + { + // We're not even close to a multiple of 60hz, so we're stuttering + // anyway. Use the true hardware speed. + config->input_rate = 32040.0; + } } emu_thread->runOnThread([&] { diff --git a/qt/src/EmuMainWindow.cpp b/qt/src/EmuMainWindow.cpp index 06148d5a..13880788 100644 --- a/qt/src/EmuMainWindow.cpp +++ b/qt/src/EmuMainWindow.cpp @@ -568,8 +568,11 @@ void EmuMainWindow::toggleFullscreen() { if (isFullScreen()) { - app->config->setVRRConfig(false); - app->updateSettings(); + if (app->config->adjust_for_vrr) + { + app->config->setVRRConfig(false); + app->updateSettings(); + } setBypassCompositor(false); showNormal(); menuBar()->setVisible(true);