mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
@@ -1571,17 +1571,18 @@ async fn start_ipc(
|
||||
if let Ok(s) = crate::ipc::connect(1000, "_cm").await {
|
||||
stream = Some(s);
|
||||
} else {
|
||||
let extra_args = if password::hide_cm() { "--hide" } else { "" };
|
||||
let run_done;
|
||||
if crate::platform::is_root() {
|
||||
let mut res = Ok(None);
|
||||
for _ in 0..10 {
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
{
|
||||
res = crate::platform::run_as_user("--cm");
|
||||
res = crate::platform::run_as_user(&format!("--cm {}", extra_args));
|
||||
}
|
||||
#[cfg(target_os = "linux")]
|
||||
{
|
||||
res = crate::platform::run_as_user("--cm", None);
|
||||
res = crate::platform::run_as_user(&format!("--cm {}", extra_args), None);
|
||||
}
|
||||
if res.is_ok() {
|
||||
break;
|
||||
@@ -1596,10 +1597,14 @@ async fn start_ipc(
|
||||
run_done = false;
|
||||
}
|
||||
if !run_done {
|
||||
let mut args = vec!["--cm"];
|
||||
if !extra_args.is_empty() {
|
||||
args.push(&extra_args);
|
||||
}
|
||||
super::CHILD_PROCESS
|
||||
.lock()
|
||||
.unwrap()
|
||||
.push(crate::run_me(vec!["--cm"])?);
|
||||
.push(crate::run_me(args)?);
|
||||
}
|
||||
for _ in 0..10 {
|
||||
sleep(0.3).await;
|
||||
|
||||
@@ -192,7 +192,7 @@ fn create_capturer(
|
||||
privacy_mode_id: i32,
|
||||
display: Display,
|
||||
use_yuv: bool,
|
||||
current: usize,
|
||||
_current: usize,
|
||||
_portable_service_running: bool,
|
||||
) -> ResultType<Box<dyn TraitCapturer>> {
|
||||
#[cfg(not(windows))]
|
||||
@@ -256,7 +256,7 @@ fn create_capturer(
|
||||
log::debug!("Create capturer dxgi|gdi");
|
||||
#[cfg(windows)]
|
||||
return crate::portable_service::client::create_capturer(
|
||||
current,
|
||||
_current,
|
||||
display,
|
||||
use_yuv,
|
||||
_portable_service_running,
|
||||
|
||||
Reference in New Issue
Block a user