fix, virtual dislay reset

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou 2023-10-31 08:19:21 +08:00
parent 7480ead76a
commit de44f8565d

View File

@ -139,12 +139,10 @@ pub fn plug_in_index_modes(
}
pub fn reset_all() -> ResultType<()> {
let mut manager = VIRTUAL_DISPLAY_MANAGER.lock().unwrap();
if !manager.peer_index_name.is_empty() || manager.headless_index_name.is_some() {
manager.install_update_driver()?;
manager.peer_index_name.clear();
manager.headless_index_name = None;
if let Err(e) = plug_out_peer_request(&get_virtual_displays()) {
log::error!("Failed to plug out virtual displays: {}", e);
}
let _ = plug_out_headless();
Ok(())
}