[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - vcl/source
Tor Lillqvist (via logerrit)
logerrit at kemper.freedesktop.org
Wed Mar 10 12:27:55 UTC 2021
vcl/source/window/seleng.cxx | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
New commits:
commit 105fc9019cd72b9ebcc3c6f01eb899696bbe8f40
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Wed Mar 10 13:06:54 2021 +0200
Commit: Tor Lillqvist <tml at collabora.com>
CommitDate: Wed Mar 10 13:26:29 2021 +0100
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 at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112261
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
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() );
}
}
More information about the Libreoffice-commits
mailing list