do not check keyboard permission on menu build

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou 2023-02-25 23:11:28 +08:00
parent e876adaec5
commit 6740587d8a

View File

@ -1542,11 +1542,15 @@ class _KeyboardMenu extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var ffiModel = Provider.of<FfiModel>(context); // Do not check permission here?
if (ffiModel.permissions['keyboard'] == false) return Offstage(); // var ffiModel = Provider.of<FfiModel>(context);
// if (ffiModel.permissions['keyboard'] == false) return Offstage();
if (stateGlobal.grabKeyboard) { if (stateGlobal.grabKeyboard) {
if (bind.sessionIsKeyboardModeSupported(id: id, mode: _kKeyMapMode)) { if (bind.sessionIsKeyboardModeSupported(id: id, mode: _kKeyMapMode)) {
bind.sessionSetKeyboardMode(id: id, value: _kKeyMapMode); bind.sessionSetKeyboardMode(id: id, value: _kKeyMapMode);
} else if (bind.sessionIsKeyboardModeSupported(
id: id, mode: _kKeyLegacyMode)) {
bind.sessionSetKeyboardMode(id: id, value: _kKeyLegacyMode);
} }
return Offstage(); return Offstage();
} }