]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_wgl.c
implemented snd_mutewhenidle cvar, defaults to 1, to allow people to
[xonotic/darkplaces.git] / vid_wgl.c
index 80c15891ce17713b45d8cd9f030d0ae931a7035e..616067f9d2d24edcd75d029c330c506e207cc042 100644 (file)
--- a/vid_wgl.c
+++ b/vid_wgl.c
@@ -380,16 +380,22 @@ void AppActivate(BOOL fActive, BOOL minimize)
        vid_activewindow = fActive;
        vid_hidden = minimize;
 
-// enable/disable sound on focus gain/loss
-       if (!vid_activewindow && sound_active)
+       // enable/disable sound on focus gain/loss
+       if (!vid_hidden && (vid_activewindow || !snd_mutewhenidle.integer))
        {
-               S_BlockSound ();
-               sound_active = false;
+               if (!sound_active)
+               {
+                       S_UnblockSound ();
+                       sound_active = true;
+               }
        }
-       else if (vid_activewindow && !sound_active)
+       else
        {
-               S_UnblockSound ();
-               sound_active = true;
+               if (sound_active)
+               {
+                       S_BlockSound ();
+                       sound_active = false;
+               }
        }
 
        if (fActive)