Move full screen cursor centering to shared code

This commit is contained in:
Camilla Löwy 2018-02-06 14:32:43 +01:00
parent b020467192
commit 58cc4b2c5c
4 changed files with 10 additions and 10 deletions

View File

@ -1178,9 +1178,6 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
_glfwPlatformShowWindow(window);
_glfwPlatformFocusWindow(window);
acquireMonitor(window);
if (wndconfig->centerCursor)
centerCursor(window);
}
return GLFW_TRUE;

View File

@ -1244,9 +1244,6 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
_glfwPlatformFocusWindow(window);
acquireMonitor(window);
fitToMonitor(window);
if (wndconfig->centerCursor)
centerCursor(window);
}
return GLFW_TRUE;

View File

@ -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)
{

View File

@ -1975,9 +1975,6 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
_glfwPlatformShowWindow(window);
updateWindowMode(window);
acquireMonitor(window);
if (wndconfig->centerCursor)
centerCursor(window);
}
XFlush(_glfw.x11.display);