feat, win10, virtual display, not support message

Signed-off-by: fufesou <shuanglongchen@yeah.ne>
This commit is contained in:
fufesou
2023-11-20 21:44:25 +08:00
parent 3a6f56ebbc
commit 83dbf88ffb
47 changed files with 134 additions and 83 deletions

View File

@@ -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);
}