fix: cannot input alt+tab when cursor is outside

This commit is contained in:
Kingtous
2022-12-20 22:07:48 +08:00
parent f0653bb10a
commit 8bb62abd3e
2 changed files with 19 additions and 3 deletions

View File

@@ -157,6 +157,11 @@ class _RemotePageState extends State<RemotePage>
focusNode: _rawKeyFocusNode,
onFocusChange: (bool v) {
_imageFocused = v;
if (_imageFocused) {
_ffi.inputModel.enterOrLeave(true);
} else {
_ffi.inputModel.enterOrLeave(false);
}
},
inputModel: _ffi.inputModel,
child: getBodyForDesktop(context)));
@@ -195,7 +200,6 @@ class _RemotePageState extends State<RemotePage>
//
}
}
_ffi.inputModel.enterOrLeave(true);
}
void leaveView(PointerExitEvent evt) {
@@ -208,7 +212,6 @@ class _RemotePageState extends State<RemotePage>
//
}
}
_ffi.inputModel.enterOrLeave(false);
}
Widget getBodyForDesktop(BuildContext context) {