diff --git a/flutter/lib/models/model.dart b/flutter/lib/models/model.dart index c622d9f10..853cf8ac0 100644 --- a/flutter/lib/models/model.dart +++ b/flutter/lib/models/model.dart @@ -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; } diff --git a/flutter/lib/web/bridge.dart b/flutter/lib/web/bridge.dart index d1b777dd1..97cac31c9 100644 --- a/flutter/lib/web/bridge.dart +++ b/flutter/lib/web/bridge.dart @@ -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 }) ])); }