mirror of
https://github.com/glfw/glfw.git
synced 2026-09-19 23:43:15 +00:00
Move all cursor positioning to platform code
Due to Wayland, shared code cannot rely on cursor positioning being supported by the underlying platform. This implicitly fixes #617 as it moves cursor centering into _glfwPlatformSetCursorMode, thus separating it from the stale value of _glfw.cursorWindow. Fixes #617.
This commit is contained in:
+1
-13
@@ -219,19 +219,7 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height,
|
||||
glfwMakeContextCurrent((GLFWwindow*) previous);
|
||||
}
|
||||
|
||||
if (window->monitor)
|
||||
{
|
||||
int width, height;
|
||||
_glfwPlatformGetWindowSize(window, &width, &height);
|
||||
|
||||
window->virtualCursorPosX = width / 2;
|
||||
window->virtualCursorPosY = height / 2;
|
||||
|
||||
_glfwPlatformSetCursorPos(window,
|
||||
window->virtualCursorPosX,
|
||||
window->virtualCursorPosY);
|
||||
}
|
||||
else
|
||||
if (!window->monitor)
|
||||
{
|
||||
if (wndconfig.visible)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user