diff --git a/src/duckstation-qt/debuggerwindow.cpp b/src/duckstation-qt/debuggerwindow.cpp index 3eefcb3e1..153c3422d 100644 --- a/src/duckstation-qt/debuggerwindow.cpp +++ b/src/duckstation-qt/debuggerwindow.cpp @@ -411,9 +411,7 @@ void DebuggerWindow::onMemorySearchStringChanged(const QString&) void DebuggerWindow::closeEvent(QCloseEvent* event) { g_emu_thread->disconnect(this); - g_emu_thread->setSystemPaused(true, true); Host::RunOnCPUThread(&CPU::ClearBreakpoints); - g_emu_thread->setSystemPaused(false); QMainWindow::closeEvent(event); emit closed(); } diff --git a/src/duckstation-qt/mainwindow.cpp b/src/duckstation-qt/mainwindow.cpp index 195ffeb94..0f9c49767 100644 --- a/src/duckstation-qt/mainwindow.cpp +++ b/src/duckstation-qt/mainwindow.cpp @@ -39,6 +39,7 @@ #include <QtCore/QFile> #include <QtCore/QFileInfo> #include <QtCore/QMimeData> +#include <QtCore/QOperatingSystemVersion> #include <QtCore/QUrl> #include <QtGui/QActionGroup> #include <QtGui/QCursor> @@ -53,6 +54,7 @@ #ifdef _WIN32 #include "common/windows_headers.h" #include <Dbt.h> +#include <VersionHelpers.h> #endif #ifdef __APPLE__ @@ -718,6 +720,9 @@ void MainWindow::quit() void MainWindow::recreate() { + // Remove subwindows before switching to surfaceless, because otherwise e.g. the debugger can cause funkyness. + destroySubWindows(); + const bool was_display_created = m_display_created; if (was_display_created) { @@ -2199,9 +2204,22 @@ void MainWindow::connectSignals() void MainWindow::setTheme(const QString& theme) { + [[maybe_unused]] const QString old_theme = + QString::fromStdString(Host::GetStringSettingValue("UI", "Theme", InterfaceSettingsWidget::DEFAULT_THEME_NAME)); + Host::SetBaseStringSettingValue("UI", "Theme", theme.toUtf8().constData()); Host::CommitBaseSettingChanges(); updateTheme(); + +#ifdef _WIN32 + if (((old_theme.isEmpty() && QOperatingSystemVersion::current() < QOperatingSystemVersion::Windows11) || + old_theme == QStringLiteral("windowsvista")) != + ((old_theme.isEmpty() && QOperatingSystemVersion::current() < QOperatingSystemVersion::Windows11) || + theme == QStringLiteral("windowsvista"))) + { + recreate(); + } +#endif } void MainWindow::updateTheme()