mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-22 13:55:38 +00:00
Qt: Fix closing log window via taskbar
This commit is contained in:
parent
bcc7ab71cb
commit
2be8287edf
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
|
|
|
@ -55,6 +55,7 @@ private:
|
|||
std::span<const char*> m_filter_names;
|
||||
|
||||
bool m_attached_to_main_window = true;
|
||||
bool m_destroying = false;
|
||||
};
|
||||
|
||||
extern LogWindow* g_log_window;
|
||||
|
|
Loading…
Reference in a new issue