Merge pull request #5331 from dignow/fix/save_peer_window_pos

fix saving peer window pos
This commit is contained in:
RustDesk
2023-08-11 08:04:57 +08:00
committed by GitHub
11 changed files with 61 additions and 51 deletions

View File

@@ -1863,14 +1863,14 @@ Future<void> setCanvasConfig(
p['yCanvas'] = yCanvas;
p['scale'] = scale;
p['currentDisplay'] = currentDisplay;
await bind.sessionSetFlutterConfig(
await bind.sessionSetFlutterOption(
sessionId: sessionId, k: canvasKey, v: jsonEncode(p));
}
Future<Map<String, dynamic>?> getCanvasConfig(SessionID sessionId) async {
if (!isWebDesktop) return null;
var p =
await bind.sessionGetFlutterConfig(sessionId: sessionId, k: canvasKey);
await bind.sessionGetFlutterOption(sessionId: sessionId, k: canvasKey);
if (p == null || p.isEmpty) return null;
try {
Map<String, dynamic> m = json.decode(p);

View File

@@ -51,7 +51,7 @@ class PeerTabModel with ChangeNotifier {
PeerTabModel(this.parent) {
// init currentTab
_currentTab =
int.tryParse(bind.getLocalFlutterConfig(k: 'peer-tab-index')) ?? 0;
int.tryParse(bind.getLocalFlutterOption(k: 'peer-tab-index')) ?? 0;
if (_currentTab < 0 || _currentTab >= tabNames.length) {
_currentTab = 0;
}