mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-24 13:41:02 +03:00
portable service only run on main display (#8525)
Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
@@ -2506,25 +2506,6 @@ impl Connection {
|
||||
}
|
||||
|
||||
async fn handle_switch_display(&mut self, s: SwitchDisplay) {
|
||||
#[cfg(windows)]
|
||||
if portable_client::running()
|
||||
&& *CONN_COUNT.lock().unwrap() > 1
|
||||
&& s.display != (*display_service::PRIMARY_DISPLAY_IDX as i32)
|
||||
{
|
||||
log::info!("Switch to non-primary display is not supported in the elevated mode when there are multiple connections.");
|
||||
let mut msg_out = Message::new();
|
||||
let res = MessageBox {
|
||||
msgtype: "nook-nocancel-hasclose".to_owned(),
|
||||
title: "Prompt".to_owned(),
|
||||
text: "switch_display_elevated_connections_tip".to_owned(),
|
||||
link: "".to_owned(),
|
||||
..Default::default()
|
||||
};
|
||||
msg_out.set_message_box(res);
|
||||
self.send(msg_out).await;
|
||||
return;
|
||||
}
|
||||
|
||||
let display_idx = s.display as usize;
|
||||
if self.display_idx != display_idx {
|
||||
if let Some(server) = self.server.upgrade() {
|
||||
@@ -2594,22 +2575,6 @@ impl Connection {
|
||||
}
|
||||
|
||||
async fn capture_displays(&mut self, add: &[usize], sub: &[usize], set: &[usize]) {
|
||||
#[cfg(windows)]
|
||||
if portable_client::running() && (add.len() > 0 || set.len() > 1) {
|
||||
log::info!("Capturing multiple displays is not supported in the elevated mode.");
|
||||
let mut msg_out = Message::new();
|
||||
let res = MessageBox {
|
||||
msgtype: "nook-nocancel-hasclose".to_owned(),
|
||||
title: "Prompt".to_owned(),
|
||||
text: "capture_display_elevated_connections_tip".to_owned(),
|
||||
link: "".to_owned(),
|
||||
..Default::default()
|
||||
};
|
||||
msg_out.set_message_box(res);
|
||||
self.send(msg_out).await;
|
||||
return;
|
||||
}
|
||||
|
||||
if let Some(sever) = self.server.upgrade() {
|
||||
let mut lock = sever.write().unwrap();
|
||||
for display in add.iter() {
|
||||
|
||||
@@ -895,7 +895,7 @@ pub mod client {
|
||||
if portable_service_running != RUNNING.lock().unwrap().clone() {
|
||||
log::info!("portable service status mismatch");
|
||||
}
|
||||
if portable_service_running {
|
||||
if portable_service_running && display.is_primary() {
|
||||
log::info!("Create shared memory capturer");
|
||||
return Ok(Box::new(CapturerPortable::new(current_display)));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user