trivial changes
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
df2de0fd61
commit
88cf61953b
@ -74,17 +74,23 @@ pub fn plug_out_headless() -> bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn get_new_device_name(device_names: &HashSet<String>) -> String {
|
fn get_new_device_name(device_names: &HashSet<String>) -> String {
|
||||||
|
for _ in 0..3 {
|
||||||
let device_names_af = windows::get_device_names();
|
let device_names_af = windows::get_device_names();
|
||||||
let diff_names: Vec<_> = device_names_af.difference(&device_names).collect();
|
let diff_names: Vec<_> = device_names_af.difference(&device_names).collect();
|
||||||
if diff_names.len() != 1 {
|
if diff_names.len() == 1 {
|
||||||
|
return diff_names[0].clone();
|
||||||
|
} else if diff_names.len() > 1 {
|
||||||
log::error!(
|
log::error!(
|
||||||
"Failed to get diff device names after plugin virtual display : {:?}",
|
"Failed to get diff device names after plugin virtual display, more than one diff names: {:?}",
|
||||||
&diff_names
|
&diff_names
|
||||||
);
|
);
|
||||||
"".to_string()
|
return "".to_string();
|
||||||
} else {
|
|
||||||
diff_names[0].clone()
|
|
||||||
}
|
}
|
||||||
|
// Sleep is needed here to wait for the virtual display to be ready.
|
||||||
|
std::thread::sleep(std::time::Duration::from_millis(50));
|
||||||
|
}
|
||||||
|
log::error!("Failed to get diff device names after plugin virtual display",);
|
||||||
|
"".to_string()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn plug_in_peer_request(modes: Vec<Vec<virtual_display::MonitorMode>>) -> ResultType<Vec<u32>> {
|
pub fn plug_in_peer_request(modes: Vec<Vec<virtual_display::MonitorMode>>) -> ResultType<Vec<u32>> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user