Removed cursor centering XFlush hack.

This commit is contained in:
Camilla Berglund 2013-08-06 20:46:26 +02:00
parent 261f290abf
commit a3ca7ad93a

View File

@ -1106,24 +1106,12 @@ void _glfwPlatformPollEvents(void)
processEvent(&event); processEvent(&event);
} }
// Check whether the cursor has moved inside an focused window that has _GLFWwindow* window = _glfw.focusedWindow;
// captured the cursor (because then it needs to be re-centered) if (window && window->cursorMode == GLFW_CURSOR_DISABLED)
_GLFWwindow* window;
window = _glfw.focusedWindow;
if (window)
{
if (window->cursorMode == GLFW_CURSOR_DISABLED)
{ {
int width, height; int width, height;
_glfwPlatformGetWindowSize(window, &width, &height); _glfwPlatformGetWindowSize(window, &width, &height);
_glfwPlatformSetCursorPos(window, width / 2, height / 2); _glfwPlatformSetCursorPos(window, width / 2, height / 2);
// NOTE: This is a temporary fix. It works as long as you use
// offsets accumulated over the course of a frame, instead of
// performing the necessary actions per callback call.
XFlush(_glfw.x11.display);
}
} }
} }