From 791aca3c2c17acdfc42b91113062edcab1e9b47b Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 21 Dec 2011 17:14:04 +0000 Subject: [PATCH] + fix changing 3d view when switching from Complete workbench to any other workbench git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5335 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d --- src/Gui/ToolBarManager.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Gui/ToolBarManager.cpp b/src/Gui/ToolBarManager.cpp index 1d07b66d8..0ae829440 100644 --- a/src/Gui/ToolBarManager.cpp +++ b/src/Gui/ToolBarManager.cpp @@ -232,6 +232,16 @@ void ToolBarManager::setup(ToolBarItem* toolBarItems) // hide all unneeded toolbars for (QList::Iterator it = toolbars.begin(); it != toolbars.end(); ++it) { + // make sure that the main window has the focus when hiding the toolbar with + // the combo box inside + QWidget *fw = QApplication::focusWidget(); + while (fw && !fw->isWindow()) { + if (fw == *it) { + getMainWindow()->setFocus(); + break; + } + fw = fw->parentWidget(); + } // ignore toolbars which do not belong to the previously active workbench QByteArray toolbarName = (*it)->objectName().toUtf8(); if (!(*it)->toggleViewAction()->isVisible())