From 8f7424820cbdd7eabaeccce4d570bec19d51705b Mon Sep 17 00:00:00 2001 From: farley <162782461+farleyrunkel@users.noreply.github.com> Date: Thu, 25 Apr 2024 22:10:33 +0800 Subject: [PATCH] Update Tree.cpp - Disable document activation when right-clicking --- src/Gui/Tree.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Gui/Tree.cpp b/src/Gui/Tree.cpp index ae950b7295..bc475b624d 100644 --- a/src/Gui/Tree.cpp +++ b/src/Gui/Tree.cpp @@ -926,7 +926,11 @@ void TreeWidget::contextMenuEvent(QContextMenuEvent* e) if (this->contextItem && this->contextItem->type() == DocumentType) { auto docitem = static_cast(this->contextItem); App::Document* doc = docitem->document()->getDocument(); - App::GetApplication().setActiveDocument(doc); + + // It's better to let user decide whether and how to activate + // the current document, such as by double-clicking. + // App::GetApplication().setActiveDocument(doc); + showHiddenAction->setChecked(docitem->showHidden()); contextMenu.addAction(this->showHiddenAction); contextMenu.addAction(this->searchObjectsAction);