platform additions

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2023-03-21 11:27:30 +08:00
parent ea584c2eb9
commit 1d122b5a73
7 changed files with 28 additions and 2 deletions

View File

@@ -259,7 +259,9 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
),
]);
if (!ffi.canvasModel.cursorEmbedded && !ffi.ffiModel.viewOnly) {
if (!ffi.canvasModel.cursorEmbedded &&
!ffi.ffiModel.viewOnly &&
!pi.is_wayland) {
menu.add(MenuEntryDivider<String>());
menu.add(RemoteMenuEntry.showRemoteCursor(
key,

View File

@@ -1684,6 +1684,9 @@ class _KeyboardMenu extends StatelessWidget {
for (KeyboardModeMenu mode in modes) {
if (bind.sessionIsKeyboardModeSupported(id: id, mode: mode.key)) {
if (pi.is_wayland && mode.key != _kKeyMapMode) {
continue;
}
if (mode.key == _kKeyTranslateMode) {
if (Platform.isLinux) {
continue;

View File

@@ -1059,7 +1059,7 @@ void showOptions(
final toggles = [
getToggle(id, setState, 'show-quality-monitor', 'Show quality monitor'),
];
if (!gFFI.canvasModel.cursorEmbedded) {
if (!gFFI.canvasModel.cursorEmbedded && !pi.is_wayland) {
toggles.insert(0,
getToggle(id, setState, 'show-remote-cursor', 'Show remote cursor'));
}

View File

@@ -452,6 +452,11 @@ class FfiModel with ChangeNotifier {
setViewOnly(peerId,
bind.sessionGetToggleOptionSync(id: peerId, arg: 'view-only'));
}
if (connType == ConnType.defaultConn) {
try {
_pi.platform_additions = json.decode(evt['platform_additions']);
} catch (e) {}
}
notifyListeners();
}
@@ -1687,6 +1692,9 @@ class PeerInfo {
List<Display> displays = [];
Features features = Features();
List<Resolution> resolutions = [];
Map<String, dynamic> platform_additions = {};
bool get is_wayland => platform_additions['is_wayland'] == true;
}
const canvasKey = 'canvas';