summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2021-03-10 13:06:54 +0200
committerTor Lillqvist <tml@collabora.com>2021-03-10 14:55:00 +0100
commita561cc4a3de175daddab03b70369ad8ccd5d417f (patch)
tree269fd409d0d3323110ca5cc1fa6131442eb4f35b
parent93b544d64bfaaa0ce9d9cb5effff72969dbb6c08 (diff)
Don't unselect an existing selection on (long) press on iOS and Android
A (long) press, also known as a long tap, in Collabora Online (as used to bring up a context menu), shows up in core as a click of the right mouse button. We don't want that to cause an existing selection to be unselected. This fixes https://github.com/CollaboraOnline/online/issues/1323 Why this problem happened only in presentation documents I have no idea. Change-Id: Iebbf71e75dcea7c39a92fd8d5dd07c368d92f163 Signed-off-by: Tor Lillqvist <tml@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112261 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112264
-rw-r--r--vcl/source/window/seleng.cxx15
1 files changed, 12 insertions, 3 deletions
diff --git a/vcl/source/window/seleng.cxx b/vcl/source/window/seleng.cxx
index 017ae30b8062..ed4e68b23c73 100644
--- a/vcl/source/window/seleng.cxx
+++ b/vcl/source/window/seleng.cxx
@@ -256,6 +256,12 @@ bool SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt )
if (!rMEvt.IsRight())
ReleaseMouse();
+#if defined IOS || defined ANDROID
+ const bool bDoMessWithSelection = !rMEvt.IsRight();
+#else
+ constexpr bool bDoMessWithSelection = true;
+#endif
+
if( (nFlags & SelectionEngineFlags::WAIT_UPEVT) && !(nFlags & SelectionEngineFlags::CMDEVT) &&
eSelMode != SelectionMode::Single)
{
@@ -271,13 +277,16 @@ bool SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt )
}
pFunctionSet->DeselectAtPoint( aLastMove.GetPosPixel() );
nFlags &= ~SelectionEngineFlags::HAS_ANCH; // uncheck anchor
- pFunctionSet->SetCursorAtPoint( aLastMove.GetPosPixel(), true );
+ if (bDoMessWithSelection)
+ pFunctionSet->SetCursorAtPoint( aLastMove.GetPosPixel(), true );
}
else
{
- pFunctionSet->DeselectAll();
+ if (bDoMessWithSelection)
+ pFunctionSet->DeselectAll();
nFlags &= ~SelectionEngineFlags::HAS_ANCH; // uncheck anchor
- pFunctionSet->SetCursorAtPoint( aLastMove.GetPosPixel() );
+ if (bDoMessWithSelection)
+ pFunctionSet->SetCursorAtPoint( aLastMove.GetPosPixel() );
}
}