Skip to content

Commit

Permalink
Qt: Fix log window disabling itself on close
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Mar 8, 2024
1 parent 7ed6801 commit 5337e46
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
16 changes: 2 additions & 14 deletions pcsx2-qt/LogWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -130,6 +126,7 @@ void LogWindow::updateWindowTitle()
void LogWindow::createUi()
{
setWindowIcon(QtHost::GetAppIcon());
setWindowFlag(Qt::WindowCloseButtonHint, false);
updateWindowTitle();

QAction* action;
Expand Down Expand Up @@ -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);
}
Expand Down
1 change: 0 additions & 1 deletion pcsx2-qt/LogWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit 5337e46

Please sign in to comment.