diff --git a/flutter/lib/models/model.dart b/flutter/lib/models/model.dart index 70e8c7d60..f7ccc4a13 100644 --- a/flutter/lib/models/model.dart +++ b/flutter/lib/models/model.dart @@ -402,10 +402,12 @@ class FfiModel with ChangeNotifier { // } + final connType = parent.target?.connType; + if (isPeerAndroid) { _touchMode = true; - if (parent.target != null && - parent.target!.connType == ConnType.defaultConn && + if (connType == ConnType.defaultConn && + parent.target != null && parent.target!.ffiModel.permissions['keyboard'] != false) { Timer( const Duration(milliseconds: 100), @@ -417,10 +419,9 @@ class FfiModel with ChangeNotifier { await bind.sessionGetOption(id: peerId, arg: 'touch-mode') != ''; } - if (parent.target != null && - parent.target!.connType == ConnType.fileTransfer) { + if (connType == ConnType.fileTransfer) { parent.target?.fileModel.onReady(); - } else { + } else if (connType == ConnType.defaultConn) { _pi.displays = []; List displays = json.decode(evt['displays']); for (int i = 0; i < displays.length; ++i) { @@ -450,8 +451,10 @@ class FfiModel with ChangeNotifier { handleResolutions(peerId, evt["resolutions"]); parent.target?.elevationModel.onPeerInfo(_pi); } - setViewOnly( - peerId, bind.sessionGetToggleOptionSync(id: peerId, arg: 'view-only')); + if (connType == ConnType.defaultConn) { + setViewOnly(peerId, + bind.sessionGetToggleOptionSync(id: peerId, arg: 'view-only')); + } notifyListeners(); }