From 9beeb53a98a5f350ff185bfe0e339f38faa70512 Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 31 Aug 2020 22:23:35 +0200 Subject: [PATCH] Gui: [skip ci] do not handle left mouse button events when in dragging or zooming mode --- src/Gui/TouchpadNavigationStyle.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Gui/TouchpadNavigationStyle.cpp b/src/Gui/TouchpadNavigationStyle.cpp index 944c7bc25e..9d8c2a0c03 100644 --- a/src/Gui/TouchpadNavigationStyle.cpp +++ b/src/Gui/TouchpadNavigationStyle.cpp @@ -312,6 +312,12 @@ SbBool TouchpadNavigationStyle::processSoEvent(const SoEvent * const ev) newmode = NavigationStyle::IDLE; break; case SHIFTDOWN: + // Shift + left mouse click enables dragging. + // If the mouse is released the event should not be forwarded to the base + // class that eventually performs a selection. + if (newmode == NavigationStyle::DRAGGING) { + processed = true; + } newmode = NavigationStyle::PANNING; break; case ALTDOWN: @@ -322,6 +328,12 @@ SbBool TouchpadNavigationStyle::processSoEvent(const SoEvent * const ev) break; case CTRLDOWN|SHIFTDOWN: case CTRLDOWN|SHIFTDOWN|BUTTON1DOWN: + // Left mouse button doesn't change the zoom + // behaviour but when pressing or releasing it then do not forward the + // event to the base class that eventually performs a selection. + if (newmode == NavigationStyle::ZOOMING) { + processed = true; + } newmode = NavigationStyle::ZOOMING; break; default: