fix: web, switch display (#9307)

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou 2024-09-10 11:29:20 +08:00 committed by GitHub
parent 943f96ef8c
commit 13effe7f14
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 7 deletions

View File

@ -497,10 +497,12 @@ class FfiModel with ChangeNotifier {
newDisplay.width = int.tryParse(evt['width']) ?? newDisplay.width;
newDisplay.height = int.tryParse(evt['height']) ?? newDisplay.height;
newDisplay.cursorEmbedded = int.tryParse(evt['cursor_embedded']) == 1;
newDisplay.originalWidth =
int.tryParse(evt['original_width']) ?? kInvalidResolutionValue;
newDisplay.originalHeight =
int.tryParse(evt['original_height']) ?? kInvalidResolutionValue;
newDisplay.originalWidth = int.tryParse(
evt['original_width'] ?? kInvalidResolutionValue.toString()) ??
kInvalidResolutionValue;
newDisplay.originalHeight = int.tryParse(
evt['original_height'] ?? kInvalidResolutionValue.toString()) ??
kInvalidResolutionValue;
newDisplay._scale = _pi.scaleOfDisplay(display);
_pi.displays[display] = newDisplay;
@ -2509,6 +2511,7 @@ class FFI {
onEvent2UIRgba();
imageModel.onRgba(display, data);
});
this.id = id;
return;
}

View File

@ -391,9 +391,9 @@ class RustdeskImpl {
return Future(() => js.context.callMethod('setByName', [
'switch_display',
jsonEncode({
isDesktop: isDesktop,
sessionId: sessionId.toString(),
value: value
'isDesktop': isDesktop,
'sessionId': sessionId.toString(),
'value': value
})
]));
}