From 444aaac1ee27f1234788d8c8c7d3ca809316ba80 Mon Sep 17 00:00:00 2001 From: forbes Date: Sat, 14 Feb 2026 12:42:17 -0600 Subject: [PATCH] fix: start page always closes on document open (#192) Remove the closeStart preference check so the start page MDI tab always closes when a document is opened or created. Re-enable QListView updates before closing to prevent Qt hang during widget destruction. Add hideEvent override as a safety net to re-enable disabled QListView updates whenever the start page is hidden. --- src/Mod/Start/Gui/StartView.cpp | 18 ++++++++++++------ src/Mod/Start/Gui/StartView.h | 1 + 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/Mod/Start/Gui/StartView.cpp b/src/Mod/Start/Gui/StartView.cpp index b764fe7630..d0636efc1b 100644 --- a/src/Mod/Start/Gui/StartView.cpp +++ b/src/Mod/Start/Gui/StartView.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include "StartView.h" @@ -383,12 +384,11 @@ void StartView::postStart(PostStartBehavior behavior) Gui::Application::Instance->activateWorkbench(wb.c_str()); } } - if (auto closeStart = hGrp->GetBool("closeStart", false)) { - for (QWidget* w = this; w != nullptr; w = w->parentWidget()) { - if (auto mdiSub = qobject_cast(w)) { - mdiSub->close(); - return; - } + setListViewUpdatesEnabled(true); + for (QWidget* w = this; w != nullptr; w = w->parentWidget()) { + if (auto mdiSub = qobject_cast(w)) { + mdiSub->close(); + return; } } } @@ -478,6 +478,12 @@ void StartView::showEvent(QShowEvent* event) Gui::MDIView::showEvent(event); } +void StartView::hideEvent(QHideEvent* event) +{ + setListViewUpdatesEnabled(true); + Gui::MDIView::hideEvent(event); +} + void StartView::onMdiSubWindowActivated(QMdiSubWindow* subWindow) { // check if start view is activated subwindow if yes, then enable updates diff --git a/src/Mod/Start/Gui/StartView.h b/src/Mod/Start/Gui/StartView.h index 59d63aeda1..d76df00a75 100644 --- a/src/Mod/Start/Gui/StartView.h +++ b/src/Mod/Start/Gui/StartView.h @@ -84,6 +84,7 @@ public: protected: void changeEvent(QEvent* e) override; void showEvent(QShowEvent* event) override; + void hideEvent(QHideEvent* event) override; void configureNewFileButtons(QLayout* layout) const; static void configureFileCardWidget(QListView* fileCardWidget); -- 2.49.1