diff options
authorRichard Moe Gustavsen <>2019-05-15 14:31:08 +0200
committerRichard Moe Gustavsen <>2019-05-15 17:37:47 +0000
commit071a0a6937432ad60c1b261af9f5b48861fbb70c (patch)
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ø <>
1 files changed, 8 insertions, 3 deletions
diff --git a/src/plugins/platforms/ios/ b/src/plugins/platforms/ios/
index e5419b1766..0561a826c6 100644
--- a/src/plugins/platforms/ios/
+++ b/src/plugins/platforms/ios/
@@ -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;
+ }