From: divverent Date: Sat, 2 Feb 2008 18:38:38 +0000 (+0000) Subject: fix bugs with changing apple_mouse_noaccel and vid_dgamouse while grabbed (that previ... X-Git-Tag: xonotic-v0.1.0preview~2451 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3de9888b783deb831a873a6bd6b3f4cddb2d233e;p=xonotic%2Fdarkplaces.git fix bugs with changing apple_mouse_noaccel and vid_dgamouse while grabbed (that previously could "destroy" mouse support until console gets pulled down and up) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8064 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/vid_agl.c b/vid_agl.c index 39b87c0e..d7a4b7c7 100644 --- a/vid_agl.c +++ b/vid_agl.c @@ -60,6 +60,7 @@ CGLContextObj (*qCGLGetCurrentContext) (void); static qboolean multithreadedgl; static qboolean mouse_avail = true; static qboolean vid_usingmouse = false; +static qboolean vid_usingnoaccel = false; static float mouse_x, mouse_y; static qboolean vid_isfullscreen = false; @@ -109,6 +110,8 @@ static void IN_Activate( qboolean grab ) { if (grab) { + if(vid_usingmouse && (vid_usingnoaccel != !!apple_mouse_noaccel.integer)) + IN_Activate(false); // ungrab first! if (!vid_usingmouse && mouse_avail && window) { Rect winBounds; @@ -158,6 +161,7 @@ static void IN_Activate( qboolean grab ) mouse_x = mouse_y = 0; vid_usingmouse = true; + vid_usingnoaccel = !!apple_mouse_noaccel.integer; } } else diff --git a/vid_glx.c b/vid_glx.c index 02911ed8..50fb0858 100644 --- a/vid_glx.c +++ b/vid_glx.c @@ -89,6 +89,7 @@ Atom wm_delete_window_atom; static qboolean mouse_avail = true; static qboolean vid_usingmouse = false; +static qboolean vid_usingdgamouse = false; static qboolean vid_usingvsync = false; static qboolean vid_usevsync = false; static qboolean vid_x11_hardwaregammasupported = false; @@ -254,6 +255,10 @@ static void IN_Activate (qboolean grab) return; if (grab) { +#if !defined(__APPLE__) && !defined(SUNOS) + if(vid_usingmouse && (vid_usingdgamouse != !!vid_dgamouse.integer)) + IN_Activate(false); // ungrab first! +#endif if (!vid_usingmouse && mouse_avail && win) { XWindowAttributes attribs_1; @@ -284,6 +289,7 @@ static void IN_Activate (qboolean grab) mouse_x = mouse_y = 0; cl_ignoremousemoves = 2; vid_usingmouse = true; + vid_usingdgamouse = !!vid_dgamouse.integer; } } else