From 5eae75ecd259cf3d428a2b778844616015c6355f Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 1 Jan 2022 10:44:41 +0100 Subject: [PATCH] Start: in Workbench::loadStartPage() raise StartPage if there is already an instance --- src/Mod/Start/Gui/Workbench.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Mod/Start/Gui/Workbench.cpp b/src/Mod/Start/Gui/Workbench.cpp index 8c01d4606f..363c374627 100644 --- a/src/Mod/Start/Gui/Workbench.cpp +++ b/src/Mod/Start/Gui/Workbench.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -74,9 +75,13 @@ void StartGui::Workbench::loadStartPage() // Ensure that we don't open the Start page multiple times QString title = QCoreApplication::translate("Workbench", "Start page"); QList ch = Gui::getMainWindow()->windows(); - for (QList::const_iterator c = ch.begin(); c != ch.end(); ++c) { - if ((*c)->windowTitle() == title) + for (QList::const_iterator c = ch.cbegin(); c != ch.cend(); ++c) { + if ((*c)->windowTitle() == title) { + Gui::MDIView* mdi = qobject_cast((*c)); + if (mdi) + Gui::getMainWindow()->setActiveWindow(mdi); return; + } } try {