diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp index 9d9adfed71..b2c7af1658 100644 --- a/src/Gui/MainWindow.cpp +++ b/src/Gui/MainWindow.cpp @@ -1169,6 +1169,10 @@ void MainWindow::onWindowActivated(QMdiSubWindow* w) return; auto view = dynamic_cast(w->widget()); + // set active the appropriate window (it needs not to be part of mdiIds, e.g. directly after creation) + d->activeView = view; + Application::Instance->viewActivated(view); + ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/View"); bool saveWB = hGrp->GetBool("SaveWBbyTab", false); if (saveWB) { @@ -1194,9 +1198,6 @@ void MainWindow::onWindowActivated(QMdiSubWindow* w) if ( !view /*|| !mdi->isActiveWindow()*/ ) return; // either no MDIView or no valid object or no top-level window - // set active the appropriate window (it needs not to be part of mdiIds, e.g. directly after creation) - d->activeView = view; - Application::Instance->viewActivated(view); updateActions(true); } diff --git a/src/Mod/Sketcher/Gui/Workbench.cpp b/src/Mod/Sketcher/Gui/Workbench.cpp index 389f4eee1f..2751b3410a 100644 --- a/src/Mod/Sketcher/Gui/Workbench.cpp +++ b/src/Mod/Sketcher/Gui/Workbench.cpp @@ -190,7 +190,6 @@ void Workbench::activated() * However, now that we are back (from another WB), we need to make the toolbars available. * These correspond to the last saved state. */ - Base::Console().Log("Sketch WB: Activated\n"); Gui::Document* doc = Gui::Application::Instance->activeDocument(); if (isSketchInEdit(doc)) { Gui::ToolBarManager::getInstance()->setState(editModeToolbarNames(),