Skip to content

Commit

Permalink
Fix isAppActive not using the correct profile when checking the Foreg…
Browse files Browse the repository at this point in the history
…roundAppsOnly option
  • Loading branch information
SaifAqqad committed Dec 23, 2023
1 parent a5965c6 commit 4133b6b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/MicMute.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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%

Expand Down

0 comments on commit 4133b6b

Please sign in to comment.