Gui: Prevent showing the context menu after dragging, panning or zooming

This commit is contained in:
Rexbas
2024-01-20 16:27:25 +01:00
parent 62c3836c97
commit dfa20b4648
10 changed files with 76 additions and 71 deletions

View File

@@ -172,15 +172,17 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
// If we are in edit mode then simply ignore the RMB events
// to pass the event to the base class.
this->lockrecenter = true;
if (!viewer->isEditing()) {
// If we are in zoom or pan mode ignore RMB events otherwise
// the canvas doesn't get any release events
// Don't show the context menu after dragging, panning or zooming
if (!press && (hasDragged || hasPanned || hasZoomed)) {
processed = true;
}
else if (!press && !viewer->isEditing()) {
if (this->currentmode != NavigationStyle::ZOOMING &&
this->currentmode != NavigationStyle::PANNING) {
this->currentmode != NavigationStyle::PANNING &&
this->currentmode != NavigationStyle::DRAGGING) {
if (this->isPopupMenuEnabled()) {
if (!press) { // release right mouse button
this->openPopupMenu(event->getPosition());
}
this->openPopupMenu(event->getPosition());
}
}
}
@@ -289,20 +291,7 @@ SbBool InventorNavigationStyle::processSoEvent(const SoEvent * const ev)
newmode = NavigationStyle::ZOOMING;
break;
// There are many cases we don't handle that just falls through to
// the default case, like SHIFTDOWN, CTRLDOWN, CTRLDOWN|SHIFTDOWN,
// SHIFTDOWN|BUTTON3DOWN, SHIFTDOWN|CTRLDOWN|BUTTON3DOWN, etc.
// This is a feature, not a bug. :-)
//
// mortene.
default:
// The default will make a spin stop and otherwise not do
// anything.
if ((curmode != NavigationStyle::SEEK_WAIT_MODE) &&
(curmode != NavigationStyle::SEEK_MODE)) {
newmode = NavigationStyle::IDLE;
}
break;
}