Closed Rik-Kirtaniya closed 1 year ago
Thanks for the report. Good catch.
Unfortunately this is not straight forward to fix as it seems to be an issue with WinAPI SetWinEventHook function. The event EVENT_SYSTEM_FOREGROUND is NOT triggered for some reason when the app is restored by clicking on the app icon on the taskbar. This leads to it not being detect by BackgroundMuter since it relies on the that event to determine which window is on foreground.
The solution will probably involve looking for a better event which can also catch this case: https://docs.microsoft.com/en-us/windows/win32/winauto/event-constants
@Rik-Kirtaniya I implemented a new algorithm for checking foreground processes. Can you check if this issue is still there?
@nefares Yup works perfectly now as expected. :)
Thanks. Will close this issue.
Reproduction: Run an application, then instead of minimizing it with the minimize button on it's title bar, minimize it using the app's icon on the taskbar. This causes Background Muter to successfully mute the app. However, when restoring the app window again by clicking on app icon on taskbar, it fails to unmute the app.
To make it work again, the app needs to be minimized using the title bar minimize button specifically, then restored using the taskbar app icon. Only then does it get unmuted again.
Would be nice if the former method also worked. :)