summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@qt.io>2019-05-15 14:31:08 +0200
committerRichard Moe Gustavsen <richard.gustavsen@qt.io>2019-05-15 17:37:47 +0000
commit071a0a6937432ad60c1b261af9f5b48861fbb70c (patch)
treec36a53d16f6aed038b8fe6403ce8bbfd7ba67537 /src/plugins
parent61d990da967d10d15cd8b73d0bee9f36387f8278 (diff)
iOS: be more careful about hiding the edit menu
The code that deals with text selection in the iOS QPA plugin, listen for changes to text selection. And depending on whether we have a selection or not, we show or hide the selection handles together with the edit menu. The problem is that the edit menu will also be told to show from other places, even if there is no selection. And for those cases, we should avoid closing it. This patch will check, before we close the edit menu, if we're tracking a selection. If not, we leave the edit menu alone. Fixes: QTBUG-75099 Change-Id: I001d818fa2ad4a215cc3fa6aa4c7faf516e1ed59 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/ios/qiostextinputoverlay.mm11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/plugins/platforms/ios/qiostextinputoverlay.mm b/src/plugins/platforms/ios/qiostextinputoverlay.mm
index e5419b1766..0561a826c6 100644
--- a/src/plugins/platforms/ios/qiostextinputoverlay.mm
+++ b/src/plugins/platforms/ios/qiostextinputoverlay.mm
@@ -834,9 +834,14 @@ static void executeBlockWithoutAnimation(Block block)
- (void)updateSelection
{
if (!hasSelection()) {
- _cursorLayer.visible = NO;
- _anchorLayer.visible = NO;
- QIOSTextInputOverlay::s_editMenu.visible = NO;
+ if (_cursorLayer.visible) {
+ _cursorLayer.visible = NO;
+ _anchorLayer.visible = NO;
+ // Only hide the edit menu if we had a selection from before, since
+ // the edit menu can also be used for other purposes by others (in
+ // which case we try our best not to interfere).
+ QIOSTextInputOverlay::s_editMenu.visible = NO;
+ }
return;
}