From b4578fb3eae842eb510a1bc055d07d369a67ce94 Mon Sep 17 00:00:00 2001 From: 0penBrain <48731257+0penBrain@users.noreply.github.com> Date: Fri, 30 Sep 2022 12:53:53 +0200 Subject: [PATCH] [Bugfix]Gui: TinkerCAD mouse mode was always stopping RMB propagation --- src/Gui/TinkerCADNavigationStyle.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/Gui/TinkerCADNavigationStyle.cpp b/src/Gui/TinkerCADNavigationStyle.cpp index a8afd7aef7..cf6d8a23b7 100644 --- a/src/Gui/TinkerCADNavigationStyle.cpp +++ b/src/Gui/TinkerCADNavigationStyle.cpp @@ -114,7 +114,7 @@ SbBool TinkerCADNavigationStyle::processSoEvent(const SoEvent * const ev) const auto event = (const SoMouseButtonEvent *) ev; const int button = event->getButton(); const SbBool press = event->getState() == SoButtonEvent::DOWN ? true : false; - SbBool canOpenPopupMenu = false; + SbBool shortRMBclick = false; switch (button) { case SoMouseButtonEvent::BUTTON1: @@ -144,7 +144,7 @@ SbBool TinkerCADNavigationStyle::processSoEvent(const SoEvent * const ev) float dci = float(QApplication::doubleClickInterval())/1000.0f; // time between press and release event if (tmp.getValue() < dci) { - canOpenPopupMenu = true; + shortRMBclick = true; } } @@ -156,14 +156,16 @@ SbBool TinkerCADNavigationStyle::processSoEvent(const SoEvent * const ev) processed = true; } else if (!press && (curmode == NavigationStyle::DRAGGING)) { - if (!viewer->isEditing() && canOpenPopupMenu) { - // If we are in drag mode but mouse hasn't been moved open the context-menu - if (this->isPopupMenuEnabled()) { - this->openPopupMenu(event->getPosition()); + if (shortRMBclick) { + newmode = NavigationStyle::IDLE; + if (!viewer->isEditing()) { + // If we are in drag mode but mouse hasn't been moved open the context-menu + if (this->isPopupMenuEnabled()) { + this->openPopupMenu(event->getPosition()); + } + processed = true; } } - newmode = NavigationStyle::IDLE; - processed = true; } break; case SoMouseButtonEvent::BUTTON3: