diff --git a/src/Gui/propertyeditor/PropertyEditor.cpp b/src/Gui/propertyeditor/PropertyEditor.cpp index b446dfc338..ea34e67fdc 100644 --- a/src/Gui/propertyeditor/PropertyEditor.cpp +++ b/src/Gui/propertyeditor/PropertyEditor.cpp @@ -261,7 +261,23 @@ void PropertyEditor::closeEditor() if (editingIndex.isValid()) { Base::StateLocker guard(closingEditor); bool hasFocus = activeEditor && activeEditor->hasFocus(); +#ifdef Q_OS_MACOS + // Brute-force workaround for https://github.com/FreeCAD/FreeCAD/issues/14350 + int currentIndex = 0; + QTabBar *tabBar = nullptr; + if (auto mdiArea = Gui::MainWindow::getInstance()->findChild()) { + tabBar = mdiArea->findChild(); + if (tabBar) { + currentIndex = tabBar->currentIndex(); + } + } +#endif closePersistentEditor(editingIndex); +#ifdef Q_OS_MACOS + if (tabBar) { + tabBar->setCurrentIndex(currentIndex); + } +#endif editingIndex = QPersistentModelIndex(); activeEditor = nullptr; if(hasFocus)