privacy_mode_win_magnifier: remove unused win event hook

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2022-06-02 10:45:27 +08:00
parent fc1af7b0d9
commit 376c042666
2 changed files with 11 additions and 97 deletions

View File

@@ -19,8 +19,6 @@
// https://slhck.info/video/2017/03/01/rate-control.html
use super::*;
#[cfg(windows)]
use crate::ui::win_privacy::win_event_hook;
use hbb_common::tokio::sync::{
mpsc::{unbounded_channel, UnboundedReceiver, UnboundedSender},
Mutex as TokioMutex,
@@ -307,16 +305,13 @@ pub fn test_create_capturer(privacy_mode_id: i32, timeout_millis: u64) -> bool {
fn check_uac_switch(privacy_mode_id: i32, captuerer_privacy_mode_id: i32) -> ResultType<()> {
if captuerer_privacy_mode_id != 0 {
if privacy_mode_id != captuerer_privacy_mode_id {
if !win_event_hook::is_process_consent_running()? {
if !crate::ui::win_privacy::is_process_consent_running()? {
bail!("consent.exe is running");
}
}
//if win_event_hook::is_desktop_switched() {
if win_event_hook::is_process_consent_running()? {
// win_event_hook::reset_desktop_switch();
if crate::ui::win_privacy::is_process_consent_running()? {
bail!("consent.exe is running");
}
//}
}
Ok(())
}
@@ -347,13 +342,14 @@ fn run(sp: GenericService) -> ResultType<()> {
#[cfg(windows)]
let mut captuerer_privacy_mode_id = privacy_mode_id;
#[cfg(windows)]
if win_event_hook::is_process_consent_running()? {
if crate::ui::win_privacy::is_process_consent_running()? {
captuerer_privacy_mode_id = 0;
}
log::debug!(
"Try create capturer with captuerer privacy mode id {}",
captuerer_privacy_mode_id,
);
if privacy_mode_id != captuerer_privacy_mode_id {
log::info!("In privacy mode, but show UAC prompt window for now");
} else {