summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2021-03-10 13:06:54 +0200
committerTor Lillqvist <tml@collabora.com>2021-03-11 10:40:05 +0200
commit205313ed3727b8e6966e3be47940ef14a59afc89 (patch)
tree4d4bdf9f703ed7c308e6bc9d8f41ef8e30b59705
parentBump version to 6.4-28 (diff)
downloadcore-private/tml/cp-6-4-28-1.tar.gz
core-private/tml/cp-6-4-28-1.zip
Don't unselect an existing selection on (long) press on iOS and Android private/tml/cp-6-4-28-1
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>
-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 41d0d5f89ec9..c8ee805b7354 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() );
}
}