mirror of
https://github.com/gwm17/glfw.git
synced 2024-11-26 20:28:49 -05:00
Removed cursor centering XFlush hack.
This commit is contained in:
parent
261f290abf
commit
a3ca7ad93a
|
@ -1106,24 +1106,12 @@ void _glfwPlatformPollEvents(void)
|
|||
processEvent(&event);
|
||||
}
|
||||
|
||||
// Check whether the cursor has moved inside an focused window that has
|
||||
// captured the cursor (because then it needs to be re-centered)
|
||||
|
||||
_GLFWwindow* window;
|
||||
window = _glfw.focusedWindow;
|
||||
if (window)
|
||||
_GLFWwindow* window = _glfw.focusedWindow;
|
||||
if (window && window->cursorMode == GLFW_CURSOR_DISABLED)
|
||||
{
|
||||
if (window->cursorMode == GLFW_CURSOR_DISABLED)
|
||||
{
|
||||
int width, height;
|
||||
_glfwPlatformGetWindowSize(window, &width, &height);
|
||||
_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);
|
||||
}
|
||||
int width, height;
|
||||
_glfwPlatformGetWindowSize(window, &width, &height);
|
||||
_glfwPlatformSetCursorPos(window, width / 2, height / 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user