Skip to content

Commit

Permalink
fix: blacklist not work (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
sigoden committed May 8, 2024
1 parent 33f3116 commit da873c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl Config {

if let Some(v) = section
.get("blacklist")
.map(|v| v.split(',').map(|v| v.trim().to_lowercase()).collect())
.map(|v| v.split(',').map(|v| v.trim().to_string()).collect())
{
conf.switch_windows_blacklist = v;
}
Expand Down
4 changes: 2 additions & 2 deletions src/foreground.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl ForegroundWatcher {
});
}

let _ = BLACKLIST.set(blacklist.clone());
let _ = BLACKLIST.set(blacklist.iter().map(|v| v.to_lowercase()).collect());

let hook = unsafe {
SetWinEventHook(
Expand Down Expand Up @@ -69,7 +69,7 @@ unsafe extern "system" fn win_event_proc(
_dwms_event_time: u32,
) {
let exe = match get_window_exe(hwnd) {
Some(v) => v,
Some(v) => v.to_lowercase(),
None => return,
};
IS_FOREGROUND_IN_BLACKLIST = BLACKLIST.get().unwrap().contains(&exe);
Expand Down

0 comments on commit da873c0

Please sign in to comment.