fix: win, privacy mode 2 (#12123)

* fix: win, privacy mode 2

Signed-off-by: fufesou <linlong1266@gmail.com>

* Update src/privacy_mode/win_virtual_display.rs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
fufesou
2025-06-19 18:39:15 +08:00
committed by GitHub
parent 590ecc43ff
commit d6ba063655
4 changed files with 92 additions and 26 deletions

View File

@@ -219,9 +219,10 @@ async fn turn_on_privacy_async(impl_key: String, conn_id: i32) -> Option<ResultT
let res = turn_on_privacy_sync(&impl_key, conn_id);
let _ = tx.send(res);
});
// Wait at most 5 seconds for the result.
// Wait at most 7.5 seconds for the result.
// Because it may take a long time to turn on the privacy mode with amyuni idd.
match hbb_common::timeout(5000, rx).await {
// Some laptops may take time to plug in a virtual display.
match hbb_common::timeout(7500, rx).await {
Ok(res) => match res {
Ok(res) => res,
Err(e) => Some(Err(anyhow!(e.to_string()))),