From 4133b6b7c1fa7233eb1fb02909f93c93ca1ccf6a Mon Sep 17 00:00:00 2001 From: Saif Alaqqad Date: Sat, 23 Dec 2023 10:53:55 +0300 Subject: [PATCH] Fix isAppActive not using the correct profile when checking the ForegroundAppsOnly option --- src/MicMute.ahk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/MicMute.ahk b/src/MicMute.ahk index 40bcba7..a3a3a3c 100644 --- a/src/MicMute.ahk +++ b/src/MicMute.ahk @@ -435,7 +435,7 @@ checkConfigDiff(){ checkLinkedApps(){ if(watched_profile){ - if(!isAppActive(watched_profile.LinkedApp)){ + if(!isAppActive(watched_profile.LinkedApp, watched_profile.ForegroundAppsOnly)){ util_log("[Main] Linked app closed: " . watched_profile.LinkedApp) watched_profile:="" switchProfile(config_obj.DefaultProfile) @@ -444,7 +444,7 @@ checkLinkedApps(){ } for _i, p in watched_profiles { - if(isAppActive(p.LinkedApp)){ + if(isAppActive(p.LinkedApp, p.ForegroundAppsOnly)){ util_log("[Main] Detected linked app: " . p.LinkedApp) watched_profile:= p switchProfile(p.ProfileName) @@ -453,8 +453,8 @@ checkLinkedApps(){ } } -isAppActive(appFile){ - if (current_profile.ForegroundAppsOnly) { +isAppActive(appFile, foregroundOnly){ + if (foregroundOnly) { windowExists := WinExist("ahk_exe " . appFile) WinGet, minState, MinMax, ahk_exe %appFile%