From: havoc Date: Thu, 20 Apr 2006 10:55:47 +0000 (+0000) Subject: grab mouse when using menu while watching demos (important for nexuiz) X-Git-Tag: xonotic-v0.1.0preview~4045 X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=4ee3e3c6cf65e316a2caa9a1cd4a12297980c253;ds=sidebyside grab mouse when using menu while watching demos (important for nexuiz) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6320 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/vid_agl.c b/vid_agl.c index a1490a6d..d8818871 100644 --- 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) { diff --git a/vid_glx.c b/vid_glx.c index 150736df..1dd9e1bf 100644 --- 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; diff --git a/vid_sdl.c b/vid_sdl.c index 0df9e422..b96a3598 100644 --- 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; diff --git a/vid_wgl.c b/vid_wgl.c index faf8ff60..a567a84e 100644 --- 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;