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 a1490a6..d881887 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 150736d..1dd9e1b 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 0df9e42..b96a359 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 faf8ff6..a567a84 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;