mirror of
https://github.com/glfw/glfw.git
synced 2025-01-19 06:25:54 +00:00
Removed cursor centering XFlush hack.
This commit is contained in:
parent
261f290abf
commit
a3ca7ad93a
@ -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;
|
||||||
{
|
_glfwPlatformGetWindowSize(window, &width, &height);
|
||||||
int width, height;
|
_glfwPlatformSetCursorPos(window, width / 2, height / 2);
|
||||||
_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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user