]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
support mute-when-idle properly
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 19 Aug 2009 06:11:51 +0000 (06:11 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 19 Aug 2009 06:11:51 +0000 (06:11 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9124 d7cf8633-e32d-0410-b094-e92efae38249

vid_agl.c

index 0c0fd7a7ede27754f5a3588f7d3a022518dd5764..b8201b6d1f8b88f35ed97977dd87005ce9faae02 100644 (file)
--- a/vid_agl.c
+++ b/vid_agl.c
@@ -473,13 +473,21 @@ static void VID_AppFocusChanged(qboolean windowIsActive)
                        VID_RestoreSystemGamma();
        }
 
-       if (sound_active != windowIsActive)
+       if (windowIsActive || !snd_mutewhenidle.integer)
        {
-               sound_active = windowIsActive;
-               if (sound_active)
+               if (!sound_active)
+               {
                        S_UnblockSound ();
-               else
+                       sound_active = true;
+               }
+       }
+       else
+       {
+               if (sound_active)
+               {
                        S_BlockSound ();
+                       sound_active = false;
+               }
        }
 }