From ea5c60af7a0f763d234a09f0f26a00864468f42e Mon Sep 17 00:00:00 2001 From: dignow Date: Sun, 10 Sep 2023 15:32:50 +0800 Subject: [PATCH 1/2] fix, android softkeyboard, 'delete input' on conn password Signed-off-by: dignow --- flutter/lib/mobile/pages/remote_page.dart | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/flutter/lib/mobile/pages/remote_page.dart b/flutter/lib/mobile/pages/remote_page.dart index 838545d0c..bd44ae5b5 100644 --- a/flutter/lib/mobile/pages/remote_page.dart +++ b/flutter/lib/mobile/pages/remote_page.dart @@ -275,7 +275,9 @@ class _RemotePageState extends State { return Offstage(); }(), _bottomWidget(), - gFFI.ffiModel.pi.isSet.isFalse ? emptyOverlay(MyTheme.canvasColor) : Offstage(), + gFFI.ffiModel.pi.isSet.isFalse + ? emptyOverlay(MyTheme.canvasColor) + : Offstage(), ], )), body: Overlay( @@ -316,12 +318,15 @@ class _RemotePageState extends State { Widget getRawPointerAndKeyBody(Widget child) { final keyboard = gFFI.ffiModel.permissions['keyboard'] != false; return RawPointerMouseRegion( - cursor: keyboard ? SystemMouseCursors.none : MouseCursor.defer, - inputModel: inputModel, - child: RawKeyFocusScope( - focusNode: _physicalFocusNode, - inputModel: inputModel, - child: child)); + cursor: keyboard ? SystemMouseCursors.none : MouseCursor.defer, + inputModel: inputModel, + child: gFFI.ffiModel.pi.isSet.isTrue + ? RawKeyFocusScope( + focusNode: _physicalFocusNode, + inputModel: inputModel, + child: child) + : child, + ); } Widget getBottomAppBar(bool keyboard) { From e1f2cd21e743b4d5996b0eb4c1f370642e184650 Mon Sep 17 00:00:00 2001 From: dignow Date: Sun, 10 Sep 2023 15:41:29 +0800 Subject: [PATCH 2/2] add comment Signed-off-by: dignow --- flutter/lib/mobile/pages/remote_page.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flutter/lib/mobile/pages/remote_page.dart b/flutter/lib/mobile/pages/remote_page.dart index bd44ae5b5..49601ece3 100644 --- a/flutter/lib/mobile/pages/remote_page.dart +++ b/flutter/lib/mobile/pages/remote_page.dart @@ -320,6 +320,8 @@ class _RemotePageState extends State { return RawPointerMouseRegion( cursor: keyboard ? SystemMouseCursors.none : MouseCursor.defer, inputModel: inputModel, + // Disable RawKeyFocusScope before the connecting is established. + // The "Delete" key on the soft keyboard may be grabbed when inputting the password dialog. child: gFFI.ffiModel.pi.isSet.isTrue ? RawKeyFocusScope( focusNode: _physicalFocusNode,