mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
restore custom resolution for each display
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
@@ -1793,6 +1793,14 @@ impl Connection {
|
||||
Some(message::Union::Misc(misc)) => match misc.union {
|
||||
Some(misc::Union::SwitchDisplay(s)) => {
|
||||
video_service::switch_display(s.display).await;
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
if s.width != 0 && s.height != 0 {
|
||||
self.change_resolution(&Resolution {
|
||||
width: s.width,
|
||||
height: s.height,
|
||||
..Default::default()
|
||||
});
|
||||
}
|
||||
}
|
||||
Some(misc::Union::ChatMessage(c)) => {
|
||||
self.send_to_cm(ipc::Data::ChatMessage { text: c.text });
|
||||
@@ -2159,10 +2167,14 @@ impl Connection {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Custom resolution here is only valid in the process of establishing a connection.
|
||||
// After the connection is established, the resolution is changed by another message.
|
||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||
if let Some(custom_resolution) = o.custom_resolution.as_ref() {
|
||||
if custom_resolution.width > 0 && custom_resolution.height > 0 {
|
||||
self.change_resolution(&custom_resolution);
|
||||
if Self::alive_conns().len() > 0 {
|
||||
if custom_resolution.width > 0 && custom_resolution.height > 0 {
|
||||
self.change_resolution(&custom_resolution);
|
||||
}
|
||||
}
|
||||
}
|
||||
if self.keyboard {
|
||||
|
||||
Reference in New Issue
Block a user