|
|
|
@ -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); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|