mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-11-23 19:49:05 +08:00
fix: android input do not handle composing (#9790)
Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
parent
f86c88b3d8
commit
4c12b83068
@ -59,7 +59,6 @@ class _RemotePageState extends State<RemotePage> with WidgetsBindingObserver {
|
||||
|
||||
final TextEditingController _textController =
|
||||
TextEditingController(text: initText);
|
||||
bool _lastComposingChangeValid = false;
|
||||
|
||||
_RemotePageState(String id) {
|
||||
initSharedStates(id);
|
||||
@ -99,9 +98,6 @@ class _RemotePageState extends State<RemotePage> with WidgetsBindingObserver {
|
||||
showToast(translate('Automatically record outgoing sessions'));
|
||||
}
|
||||
});
|
||||
if (isAndroid) {
|
||||
_textController.addListener(textAndroidListener);
|
||||
}
|
||||
WidgetsBinding.instance.addObserver(this);
|
||||
}
|
||||
|
||||
@ -132,9 +128,6 @@ class _RemotePageState extends State<RemotePage> with WidgetsBindingObserver {
|
||||
// The inner logic of `on_voice_call_closed` will check if the voice call is active.
|
||||
// Only one client is considered here for now.
|
||||
gFFI.chatModel.onVoiceCallClosed("End connetion");
|
||||
if (isAndroid) {
|
||||
_textController.removeListener(textAndroidListener);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
@ -145,13 +138,6 @@ class _RemotePageState extends State<RemotePage> with WidgetsBindingObserver {
|
||||
});
|
||||
}
|
||||
|
||||
// This listener is used to handle the composing region changes for Android soft keyboard input.
|
||||
void textAndroidListener() {
|
||||
if (_lastComposingChangeValid) {
|
||||
_handleNonIOSSoftKeyboardInput(_textController.text);
|
||||
}
|
||||
}
|
||||
|
||||
// to-do: It should be better to use transparent color instead of the bgColor.
|
||||
// But for now, the transparent color will cause the canvas to be white.
|
||||
// I'm sure that the white color is caused by the Overlay widget in BlockableOverlay.
|
||||
@ -236,12 +222,6 @@ class _RemotePageState extends State<RemotePage> with WidgetsBindingObserver {
|
||||
}
|
||||
|
||||
void _handleNonIOSSoftKeyboardInput(String newValue) {
|
||||
_lastComposingChangeValid = _textController.value.isComposingRangeValid;
|
||||
if (_lastComposingChangeValid && newValue.length > _value.length) {
|
||||
// Only early return if is composing new words.
|
||||
// We need to send `backspace` immediately if is deleting letters.
|
||||
return;
|
||||
}
|
||||
var oldValue = _value;
|
||||
_value = newValue;
|
||||
if (oldValue.isNotEmpty &&
|
||||
|
Loading…
Reference in New Issue
Block a user