]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_wgl.c
the big chat area/font patch... hope it works well. Tested in Nexuiz and Quake. Fonts...
[xonotic/darkplaces.git] / vid_wgl.c
index 80c15891ce17713b45d8cd9f030d0ae931a7035e..322eb6b9b403d7102016bdc87db2ed0aa928dd07 100644 (file)
--- a/vid_wgl.c
+++ b/vid_wgl.c
@@ -131,6 +131,8 @@ static HRESULT (WINAPI *pDirectInputCreate)(HINSTANCE hinst, DWORD dwVersion, LP
 #ifndef MK_XBUTTON1
    #define MK_XBUTTON1         0x0020
    #define MK_XBUTTON2         0x0040
+#endif
+#ifndef MK_XBUTTON3
 // LordHavoc: lets hope this allows more buttons in the future...
    #define MK_XBUTTON3         0x0080
    #define MK_XBUTTON4         0x0100
@@ -380,16 +382,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)