mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-18 02:31:00 +03:00
feat, win10, virtual display, not support message
Signed-off-by: fufesou <shuanglongchen@yeah.ne>
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
#[cfg(target_os = "windows")]
|
||||
use hbb_common::platform::windows::is_windows_version_or_greater;
|
||||
use hbb_common::{allow_err, bail, lazy_static, log, ResultType};
|
||||
use std::{
|
||||
collections::{HashMap, HashSet},
|
||||
@@ -53,6 +55,17 @@ impl VirtualDisplayManager {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_virtual_display_supported() -> bool {
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
is_windows_version_or_greater(10, 0, 19041, 0, 0)
|
||||
}
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
{
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
pub fn install_update_driver() -> ResultType<()> {
|
||||
VIRTUAL_DISPLAY_MANAGER
|
||||
.lock()
|
||||
@@ -146,6 +159,10 @@ pub fn plug_in_index_modes(
|
||||
}
|
||||
|
||||
pub fn reset_all() -> ResultType<()> {
|
||||
if is_virtual_display_supported() {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
if let Err(e) = plug_out_peer_request(&get_virtual_displays()) {
|
||||
log::error!("Failed to plug out virtual displays: {}", e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user