Commit 58cc4b2c authored by Camilla Löwy's avatar Camilla Löwy
Browse files

Move full screen cursor centering to shared code

parent b0204671
......@@ -1178,9 +1178,6 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
_glfwPlatformShowWindow(window);
_glfwPlatformFocusWindow(window);
acquireMonitor(window);
if (wndconfig->centerCursor)
centerCursor(window);
}
return GLFW_TRUE;
......
......@@ -1244,9 +1244,6 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
_glfwPlatformFocusWindow(window);
acquireMonitor(window);
fitToMonitor(window);
if (wndconfig->centerCursor)
centerCursor(window);
}
return GLFW_TRUE;
......
......@@ -226,7 +226,16 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height,
}
}
if (!window->monitor)
if (window->monitor)
{
if (wndconfig.centerCursor)
{
int width, height;
_glfwPlatformGetWindowSize(window, &width, &height);
_glfwPlatformSetCursorPos(window, width / 2.0, height / 2.0);
}
}
else
{
if (wndconfig.visible)
{
......
......@@ -1975,9 +1975,6 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
_glfwPlatformShowWindow(window);
updateWindowMode(window);
acquireMonitor(window);
if (wndconfig->centerCursor)
centerCursor(window);
}
XFlush(_glfw.x11.display);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment