From 5337e46f436f4b7885ed784f0a369f3238a0db09 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Fri, 8 Mar 2024 16:21:46 +1000 Subject: [PATCH] Qt: Fix log window disabling itself on close --- pcsx2-qt/LogWindow.cpp | 16 ++-------------- pcsx2-qt/LogWindow.h | 1 - 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/pcsx2-qt/LogWindow.cpp b/pcsx2-qt/LogWindow.cpp index 1d3861f37e947..81fb54716d121 100644 --- a/pcsx2-qt/LogWindow.cpp +++ b/pcsx2-qt/LogWindow.cpp @@ -76,7 +76,6 @@ void LogWindow::updateSettings() } else if (g_log_window) { - g_log_window->m_destroying = true; g_log_window->close(); g_log_window->deleteLater(); g_log_window = nullptr; @@ -89,7 +88,6 @@ void LogWindow::destroy() if (!g_log_window) return; - g_log_window->m_destroying = true; g_log_window->close(); g_log_window->deleteLater(); g_log_window = nullptr; @@ -101,8 +99,6 @@ void LogWindow::reattachToMainWindow() if (g_main_window->windowState() & (Qt::WindowMaximized | Qt::WindowFullScreen)) return; - resize(width(), g_main_window->height()); - const QPoint new_pos = g_main_window->pos() + QPoint(g_main_window->width() + 10, 0); if (pos() != new_pos) move(new_pos); @@ -130,6 +126,7 @@ void LogWindow::updateWindowTitle() void LogWindow::createUi() { setWindowIcon(QtHost::GetAppIcon()); + setWindowFlag(Qt::WindowCloseButtonHint, false); updateWindowTitle(); QAction* action; @@ -253,16 +250,7 @@ void LogWindow::closeEvent(QCloseEvent* event) { Log::SetHostOutputLevel(LOGLEVEL_NONE, nullptr); - // Save size when actually closing, disable ourselves if the user closed us. - if (m_destroying) - { - saveSize(); - } - else - { - Host::SetBaseBoolSettingValue("Logging", "EnableLogWindow", false); - Host::CommitBaseSettingChanges(); - } + saveSize(); QMainWindow::closeEvent(event); } diff --git a/pcsx2-qt/LogWindow.h b/pcsx2-qt/LogWindow.h index 942ec3c231200..692d47b6d8f5a 100644 --- a/pcsx2-qt/LogWindow.h +++ b/pcsx2-qt/LogWindow.h @@ -48,7 +48,6 @@ private Q_SLOTS: QMenu* m_level_menu; bool m_attached_to_main_window = true; - bool m_destroying = false; }; extern LogWindow* g_log_window;