fix, elevated mode, switch display

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2023-11-29 23:44:28 +08:00
parent 19e8ca6c06
commit 5a8a64d284
40 changed files with 55 additions and 9 deletions

View File

@@ -2326,6 +2326,22 @@ 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: "switch_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() {

View File

@@ -878,15 +878,7 @@ pub mod client {
}
if portable_service_running {
log::info!("Create shared memory capturer");
if current_display == *display_service::PRIMARY_DISPLAY_IDX {
return Ok(Box::new(CapturerPortable::new(current_display)));
} else {
bail!(
"Ignore capture display index: {}, the primary display index is: {}",
current_display,
*display_service::PRIMARY_DISPLAY_IDX
);
}
return Ok(Box::new(CapturerPortable::new(current_display)));
} else {
log::debug!("Create capturer dxgi|gdi");
return Ok(Box::new(