]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
grab mouse when using menu while watching demos (important for nexuiz)
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 20 Apr 2006 10:55:47 +0000 (10:55 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 20 Apr 2006 10:55:47 +0000 (10:55 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6320 d7cf8633-e32d-0410-b094-e92efae38249

vid_agl.c
vid_glx.c
vid_sdl.c
vid_wgl.c

index a1490a6d50ce0e1ccbdc979e5cfb9c71ada1b99a..d88188713ad26a2a5ddcd97f0f7e48a3f60267ac 100644 (file)
--- a/vid_agl.c
+++ b/vid_agl.c
@@ -111,7 +111,7 @@ void VID_Finish (qboolean allowmousegrab)
 
        // handle the mouse state when windowed if that's changed
        vid_usemouse = false;
-       if (allowmousegrab && vid_mouse.integer && !key_consoleactive && !cls.demoplayback)
+       if (allowmousegrab && vid_mouse.integer && !key_consoleactive && (key_dest != key_game || !cls.demoplayback))
                vid_usemouse = true;
        if (!vid_activewindow)
                vid_usemouse = false;
@@ -274,7 +274,7 @@ void VID_Shutdown(void)
                qaglDestroyContext(context);
                context = NULL;
        }
-       
+
        if (vid_isfullscreen)
                CGReleaseAllDisplays();
 
@@ -444,11 +444,11 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp, int refreshrate
                CGDirectDisplayID mainDisplay;
                CFDictionaryRef refDisplayMode;
                GDHandle gdhDisplay;
-               
+
                // Get the mainDisplay and set resolution to current
                mainDisplay = CGMainDisplayID();
                CGDisplayCapture(mainDisplay);
-               
+
                // TOCHECK: not sure whether or not it's necessary to change the resolution
                // "by hand", or if aglSetFullscreen does the job anyway
                refDisplayMode = CGDisplayBestModeForParametersAndRefreshRate(mainDisplay, bpp, width, height, refreshrate, NULL);
@@ -478,7 +478,7 @@ int VID_InitMode(int fullscreen, int width, int height, int bpp, int refreshrate
        }
 
        // Make the context the current one ('enable' it)
-       qaglSetCurrentContext(context);   
+       qaglSetCurrentContext(context);
        error = qaglGetError();
        if (error != AGL_NO_ERROR)
        {
index 150736df5b9ae4d5f874c33ad5cbf8cc1d406c5e..1dd9e1bff760b39e3a3d6cb9553c9949011f135a 100644 (file)
--- a/vid_glx.c
+++ b/vid_glx.c
@@ -575,7 +575,7 @@ void VID_Finish (qboolean allowmousegrab)
 
 // handle the mouse state when windowed if that's changed
        vid_usemouse = false;
-       if (allowmousegrab && vid_mouse.integer && !key_consoleactive && !cls.demoplayback)
+       if (allowmousegrab && vid_mouse.integer && !key_consoleactive && (key_dest != key_game || !cls.demoplayback))
                vid_usemouse = true;
        if (!vid_activewindow)
                vid_usemouse = false;
index 0df9e422a0b1649ca1d809584d86c9c1bdc23d13..b96a3598715383314161b2fde4a418d35fbd340d 100644 (file)
--- a/vid_sdl.c
+++ b/vid_sdl.c
@@ -503,7 +503,7 @@ void VID_Finish (qboolean allowmousegrab)
                vid_activewindow = true;
 
        vid_usemouse = false;
-       if( allowmousegrab && vid_mouse.integer && !key_consoleactive && !cls.demoplayback )
+       if( allowmousegrab && vid_mouse.integer && !key_consoleactive && (key_dest != key_game || !cls.demoplayback) )
                vid_usemouse = true;
        if( vid_isfullscreen )
                vid_usemouse = true;
index faf8ff606a5890e25b9dc9abb5694fb4ed5d0809..a567a84efaa472f7a74c68feceac8a4c5354ffb3 100644 (file)
--- a/vid_wgl.c
+++ b/vid_wgl.c
@@ -275,7 +275,7 @@ void VID_Finish (qboolean allowmousegrab)
 
 // handle the mouse state when windowed if that's changed
        vid_usemouse = false;
-       if (allowmousegrab && vid_mouse.integer && !key_consoleactive && !cls.demoplayback)
+       if (allowmousegrab && vid_mouse.integer && !key_consoleactive && (key_dest != key_game || !cls.demoplayback))
                vid_usemouse = true;
        if (vid_isfullscreen)
                vid_usemouse = true;