]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix bugs with changing apple_mouse_noaccel and vid_dgamouse while grabbed (that previ...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 2 Feb 2008 18:38:38 +0000 (18:38 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 2 Feb 2008 18:38:38 +0000 (18:38 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8064 d7cf8633-e32d-0410-b094-e92efae38249

vid_agl.c
vid_glx.c

index 39b87c0e8126b9b1c3c183dd0330dbc5adbfe289..d7a4b7c70ebe260efc1e5211899e930cea7ef6b7 100644 (file)
--- 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
index 02911ed859ace7808796cf6a4a4c9742ca233d80..50fb0858a2656e9b7a8e711e5a536e0dc4c58b74 100644 (file)
--- 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