There is race when pointer is warped and there is no pending events then in the next frame we are pulling an event related to mouse movement before warping and we are receiving abnormal mouse movement.
--- ois/trunk/src/linux/LinuxMouse.cpp (revision 38)
+++ ois/trunk/src/linux/LinuxMouse.cpp (working copy)
@@ -174,6 +174,13 @@
//Compute this frames Relative X & Y motion
int dx = event.xmotion.x - oldXMouseX;
int dy = event.xmotion.y - oldXMouseY;
+ // Because of reason unknown there is race when pointer is warped and there is no pending events
+ // then in the next frame we are pulling an event related to mouse movement before warping
+ // and we are receiving abnormal mouse movement
+ int max_diff = (mState.width >> 2) + (mState.width >> 3);
+ if(dx < -max_diff || dx > max_diff || dy < -max_diff || dy > max_diff)
//Store old values for next time to compute relative motion
oldXMouseX = event.xmotion.x;
Log in to post a comment.