Skip to content

Commit

Permalink
Qt: Fix closing log window via taskbar
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanTheToaster authored and stenzek committed Mar 21, 2024
1 parent 23d98e9 commit 3f4d9fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pcsx2-qt/LogWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ 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;
Expand All @@ -88,6 +89,7 @@ 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;
Expand Down Expand Up @@ -248,6 +250,11 @@ void LogWindow::logCallback(LOGLEVEL level, ConsoleColors color, std::string_vie

void LogWindow::closeEvent(QCloseEvent* event)
{
if (!m_destroying)
{
event->ignore();
return;
}
Log::SetHostOutputLevel(LOGLEVEL_NONE, nullptr);

saveSize();
Expand Down
1 change: 1 addition & 0 deletions pcsx2-qt/LogWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ private Q_SLOTS:
QMenu* m_level_menu;

bool m_attached_to_main_window = true;
bool m_destroying = false;
};

extern LogWindow* g_log_window;

0 comments on commit 3f4d9fd

Please sign in to comment.