diff --git a/qt/tabbed_window.py b/qt/tabbed_window.py index 83f1c5c8..30f004ec 100644 --- a/qt/tabbed_window.py +++ b/qt/tabbed_window.py @@ -344,6 +344,11 @@ class TabBarWindow(TabWindow): @pyqtSlot(int) def onTabCloseRequested(self, index): current_widget = self.getWidgetAtIndex(index) + if isinstance(current_widget, DirectoriesDialog): + # On MacOS, the tab has a close button even though we explicitely + # set it to None in order to hide it. This should prevent + # the "Directories" tab from closing by mistake. + return current_widget.close() self.stackedWidget.removeWidget(current_widget) # In this case the signal will take care of the tab itself after removing the widget