Adds s_muteWhenUnfocused: Mutes the game sounds when the window does not have focus. This is much like s_muteWhenMinimized, but it instead does what I expected that variable to do: mute the game when I'm alt-tabbed out of it. The "unfocused" state is a superset of the "minimized" state, since something can't be minimized and in focus, but it can (in windowed mode) be both visible and unfocused. The s_muteWhenMinimized cvar will still work as it always has, but if s_muteWhenMinimized is 0 and s_muteWhenInactive is 1, s_muteWhenInactive will take priority. I would merge them into one cvar and just mute when inactive, but that would disallow users from optionally hearing sound while the game is open and visible in a window but they're clicking around in some other app.
Created attachment 1856 [details] implementation