OnApplicationFocus() not called on Windows when in fullscreen mode

MonoBehaviour.OnApplicationFocus() does not get called when Windows Standalone player is minimized, if it was running in fullscreen mode. Minimizing can be done eg. by pressing Alt+Tab, Win+D or Win+M. This happens at least on Windows 7 and 8.

If the player is running in a window, all of the above minimization commands result in OnApplicationFocus() getting called as one would expect. The issue is only present when running in fullscreen mode.

Our game will not pass certification because we have no way of reliably muting audio on focus loss. Are there any other ways of detecting when the player is minimized? Are there any possible workarounds? Or do we have to remove music and ambient sounds from our game?

Audio keeps playing regardless of whether “run in background” is on or off. (Related note: shouldn’t audio be paused automatically if the application isn’t supposed to run in the background?)

I tried using Input.GetKey() to detect any key combination that results in minimization, but Unity never receives the keyboard events before getting minimized. Again, toggling “run in background” had no effect.

I can confirm the same problem exists in Windows Vista. Is there a fix due for this?

Seems to work in Unity 4.2.0f4. Good job!