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())