Fix. Multi-display connection, resolutions (#7782)

* fix: multi-display, change resolution

Signed-off-by: fufesou <shuanglongchen@yeah.net>

* fix: multi-displays, resolutions of displays

Signed-off-by: fufesou <shuanglongchen@yeah.net>

* fix: build

Signed-off-by: fufesou <shuanglongchen@yeah.net>

* refact: Function rename

Signed-off-by: fufesou <shuanglongchen@yeah.net>

* refact. Function rename

Signed-off-by: fufesou <shuanglongchen@yeah.net>

---------

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2024-04-20 14:54:23 +08:00
committed by GitHub
parent d4a1d4cd7e
commit fb1aa9c028
7 changed files with 105 additions and 18 deletions

View File

@@ -715,6 +715,8 @@ class FfiModel with ChangeNotifier {
// Map clone is required here, otherwise "evt" may be changed by other threads through the reference.
// Because this function is asynchronous, there's an "await" in this function.
cachedPeerData.peerInfo = {...evt};
// Do not cache resolutions, because a new display connection have different resolutions.
cachedPeerData.peerInfo.remove('resolutions');
// Recent peer is updated by handle_peer_info(ui_session_interface.rs) --> handle_peer_info(client.rs) --> save_config(client.rs)
bind.mainLoadRecentPeers();
@@ -770,7 +772,9 @@ class FfiModel with ChangeNotifier {
}
Map<String, dynamic> features = json.decode(evt['features']);
_pi.features.privacyMode = features['privacy_mode'] == 1;
handleResolutions(peerId, evt["resolutions"]);
if (!isCache) {
handleResolutions(peerId, evt["resolutions"]);
}
parent.target?.elevationModel.onPeerInfo(_pi);
}
if (connType == ConnType.defaultConn) {
@@ -2317,6 +2321,8 @@ class FFI {
}
await ffiModel.handleCachedPeerData(data, id);
await sessionRefreshVideo(sessionId, ffiModel.pi);
await bind.sessionRequestNewDisplayInitMsgs(
sessionId: sessionId, display: ffiModel.pi.currentDisplay);
});
isToNewWindowNotified.value = true;
}

View File

@@ -1577,5 +1577,10 @@ class RustdeskImpl {
throw UnimplementedError();
}
Future<void> sessionRequestNewDisplayInitMsgs(
{required UuidValue sessionId, required int display, dynamic hint}) {
throw UnimplementedError();
}
void dispose() {}
}