diff --git a/src/duckstation-qt/displaywidget.cpp b/src/duckstation-qt/displaywidget.cpp index 0a1f665a2..f9e5be2e1 100644 --- a/src/duckstation-qt/displaywidget.cpp +++ b/src/duckstation-qt/displaywidget.cpp @@ -138,21 +138,21 @@ void DisplayWidget::updateCursor(bool hidden) void DisplayWidget::handleCloseEvent(QCloseEvent* event) { + event->ignore(); + // Closing the separate widget will either cancel the close, or trigger shutdown. // In the latter case, it's going to destroy us, so don't let Qt do it first. // Treat a close event while fullscreen as an exit, that way ALT+F4 closes DuckStation, // rather than just the game. if (QtHost::IsSystemValid() && !isActuallyFullscreen()) { - QMetaObject::invokeMethod(g_main_window, "requestShutdown", Q_ARG(bool, true), Q_ARG(bool, true), - Q_ARG(bool, false)); + QMetaObject::invokeMethod(g_main_window, "requestShutdown", Qt::QueuedConnection, Q_ARG(bool, true), + Q_ARG(bool, true), Q_ARG(bool, false)); } else { - QMetaObject::invokeMethod(g_main_window, "requestExit"); + QMetaObject::invokeMethod(g_main_window, "requestExit", Qt::QueuedConnection); } - - event->ignore(); } void DisplayWidget::destroy() diff --git a/src/duckstation-qt/logwindow.cpp b/src/duckstation-qt/logwindow.cpp index 67dafb862..03944fe44 100644 --- a/src/duckstation-qt/logwindow.cpp +++ b/src/duckstation-qt/logwindow.cpp @@ -31,8 +31,8 @@ LogWindow::~LogWindow() = default; void LogWindow::updateSettings() { - const bool new_enabled = Host::GetBaseBoolSettingValue("Logging", "LogToWindow", false); - const bool attach_to_main = Host::GetBaseBoolSettingValue("Logging", "AttachLogWindowToMainWindow", true); + const bool new_enabled = Host::GetBoolSettingValue("Logging", "LogToWindow", false); + const bool attach_to_main = Host::GetBoolSettingValue("Logging", "AttachLogWindowToMainWindow", true); const bool curr_enabled = (g_log_window != nullptr); if (new_enabled == curr_enabled) { diff --git a/src/duckstation-qt/mainwindow.cpp b/src/duckstation-qt/mainwindow.cpp index 2056d3555..719e51b5c 100644 --- a/src/duckstation-qt/mainwindow.cpp +++ b/src/duckstation-qt/mainwindow.cpp @@ -1980,7 +1980,7 @@ bool MainWindow::shouldHideMouseCursor() const bool MainWindow::shouldHideMainWindow() const { - return Host::GetBaseBoolSettingValue("Main", "HideMainWindowWhenRunning", false) || + return Host::GetBoolSettingValue("Main", "HideMainWindowWhenRunning", false) || (g_emu_thread->shouldRenderToMain() && !isRenderingToMain()) || QtHost::InNoGUIMode(); } @@ -2872,7 +2872,7 @@ bool MainWindow::requestShutdown(bool allow_confirm /* = true */, bool allow_sav save_state &= allow_save_to_state; // Only confirm on UI thread because we need to display a msgbox. - if (!m_is_closing && allow_confirm && Host::GetBaseBoolSettingValue("Main", "ConfirmPowerOff", true)) + if (!m_is_closing && allow_confirm && Host::GetBoolSettingValue("Main", "ConfirmPowerOff", true)) { SystemLock lock(pauseAndLockSystem()); diff --git a/src/duckstation-qt/qthost.cpp b/src/duckstation-qt/qthost.cpp index b00449c60..47c472749 100644 --- a/src/duckstation-qt/qthost.cpp +++ b/src/duckstation-qt/qthost.cpp @@ -632,14 +632,12 @@ void EmuThread::checkForSettingsChanges(const Settings& old_settings) updatePerformanceCounters(); } - if (g_gpu_device) + const bool render_to_main = shouldRenderToMain(); + if (m_is_rendering_to_main != render_to_main) { - const bool render_to_main = shouldRenderToMain(); - if (m_is_rendering_to_main != render_to_main) - { - m_is_rendering_to_main = render_to_main; + m_is_rendering_to_main = render_to_main; + if (g_gpu_device) g_gpu_device->UpdateWindow(); - } } }