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
stenzek committed Mar 20, 2024
1 parent bcc7ab7 commit 2be8287
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/duckstation-qt/logwindow.cpp
Expand Up @@ -59,6 +59,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 @@ -70,6 +71,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 @@ -306,6 +308,12 @@ void LogWindow::logCallback(void* pUserParam, const char* channelName, const cha

void LogWindow::closeEvent(QCloseEvent* event)
{
if (!m_destroying)
{
event->ignore();
return;
}

Log::UnregisterCallback(&LogWindow::logCallback, this);

saveSize();
Expand Down
1 change: 1 addition & 0 deletions src/duckstation-qt/logwindow.h
Expand Up @@ -55,6 +55,7 @@ private Q_SLOTS:
std::span<const char*> m_filter_names;

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

extern LogWindow* g_log_window;

0 comments on commit 2be8287

Please sign in to comment.