diff --git a/src/Gui/ToolBarManager.cpp b/src/Gui/ToolBarManager.cpp index 61232d64bf8e..3a73a0b398bc 100644 --- a/src/Gui/ToolBarManager.cpp +++ b/src/Gui/ToolBarManager.cpp @@ -841,21 +841,8 @@ void ToolBarManager::onTimer() void ToolBarManager::saveState() const { auto ignoreSave = [](QAction* action) { - // If the toggle action is invisible then it's controlled by the application. - // In this case the current state is not saved. - if (!action->isVisible()) { - return true; - } - - QVariant property = action->property("DefaultVisibility"); - if (property.isNull()) { - return false; - } - - // If DefaultVisibility is Unavailable then never save the state because it's - // always controlled by the client code. - auto value = static_cast(property.toInt()); - return value == ToolBarItem::DefaultVisibility::Unavailable; + // Only save state for toolbars whose toggle action is user-visible. + return !action->isVisible(); }; QList toolbars = toolBars(); diff --git a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp index a5c80f39f7..1fa3a9ba8a 100644 --- a/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp +++ b/src/Mod/Sketcher/Gui/ViewProviderSketch.cpp @@ -3915,8 +3915,6 @@ void ViewProviderSketch::unsetEdit(int ModNum) auto gridnode = getGridNode(); pcRoot->removeChild(gridnode); - Workbench::leaveEditMode(); - if (listener) { Gui::getMainWindow()->removeEventFilter(listener.get()); listener.reset();