mirror of
https://github.com/rustdesk/rustdesk
synced 2026-04-21 13:27:19 +00:00
Merge 8370656fab into 91aff3ffd1
This commit is contained in:
commit
659b26a558
1 changed files with 20 additions and 0 deletions
|
|
@ -154,9 +154,29 @@ class _RemotePageState extends State<RemotePage> with WidgetsBindingObserver {
|
|||
void didChangeAppLifecycleState(AppLifecycleState state) {
|
||||
if (state == AppLifecycleState.resumed) {
|
||||
trySyncClipboard();
|
||||
_restoreInputOnResume();
|
||||
}
|
||||
}
|
||||
|
||||
// Fix: restore keyboard/mouse input after returning from background on iPadOS.
|
||||
// Bug: switching apps on iPadOS loses all input (keyboard, trackpad, touch).
|
||||
// Root cause: iOS drops the focus node when app goes to background; nobody re-requests it.
|
||||
// Fix: on resume, restart mouse listener and re-request physical focus with a small
|
||||
// delay (same pattern already used in onSoftKeyboardChanged for iOS keyboard workaround).
|
||||
void _restoreInputOnResume() {
|
||||
if (!isIOS) return;
|
||||
gFFI.inputModel.listenToMouse(true);
|
||||
_iosKeyboardWorkaroundTimer?.cancel();
|
||||
_iosKeyboardWorkaroundTimer = Timer(Duration(milliseconds: 100), () {
|
||||
if (!mounted) return;
|
||||
_physicalFocusNode.unfocus();
|
||||
_iosKeyboardWorkaroundTimer = Timer(Duration(milliseconds: 50), () {
|
||||
if (!mounted) return;
|
||||
_physicalFocusNode.requestFocus();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// For client side
|
||||
// When swithing from other app to this app, try to sync clipboard.
|
||||
void trySyncClipboard() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue