mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-11 15:21:01 +03:00
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:
@@ -1222,7 +1222,7 @@ impl<T: InvokeUiSession> Session<T> {
|
||||
pub fn change_resolution(&self, display: i32, width: i32, height: i32) {
|
||||
*self.last_change_display.lock().unwrap() =
|
||||
ChangeDisplayRecord::new(display, width, height);
|
||||
self.do_change_resolution(width, height);
|
||||
self.do_change_resolution(display, width, height);
|
||||
}
|
||||
|
||||
#[inline]
|
||||
@@ -1232,13 +1232,22 @@ impl<T: InvokeUiSession> Session<T> {
|
||||
}
|
||||
}
|
||||
|
||||
fn do_change_resolution(&self, width: i32, height: i32) {
|
||||
fn do_change_resolution(&self, display: i32, width: i32, height: i32) {
|
||||
let mut misc = Misc::new();
|
||||
misc.set_change_resolution(Resolution {
|
||||
let resolution = Resolution {
|
||||
width,
|
||||
height,
|
||||
..Default::default()
|
||||
});
|
||||
};
|
||||
if crate::common::is_support_multi_ui_session_num(self.lc.read().unwrap().version) {
|
||||
misc.set_change_display_resolution(DisplayResolution {
|
||||
display,
|
||||
resolution: Some(resolution).into(),
|
||||
..Default::default()
|
||||
});
|
||||
} else {
|
||||
misc.set_change_resolution(resolution);
|
||||
}
|
||||
let mut msg = Message::new();
|
||||
msg.set_misc(misc);
|
||||
self.send(Data::Message(msg));
|
||||
@@ -1293,6 +1302,22 @@ impl<T: InvokeUiSession> Session<T> {
|
||||
log::error!("selected invalid sid: {}", sid);
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn request_init_msgs(&self, display: usize) {
|
||||
self.send_message_query(display);
|
||||
}
|
||||
|
||||
fn send_message_query(&self, display: usize) {
|
||||
let mut misc = Misc::new();
|
||||
misc.set_message_query(MessageQuery {
|
||||
switch_display: display as _,
|
||||
..Default::default()
|
||||
});
|
||||
let mut msg = Message::new();
|
||||
msg.set_misc(misc);
|
||||
self.send(Data::Message(msg));
|
||||
}
|
||||
}
|
||||
|
||||
pub trait InvokeUiSession: Send + Sync + Clone + 'static + Sized + Default {
|
||||
|
||||
Reference in New Issue
Block a user