Move full screen cursor centering to shared code

master
Camilla Löwy ago%!(EXTRA string=7 years)
parent b020467192
commit 58cc4b2c5c
  1. 3
      src/cocoa_window.m
  2. 3
      src/win32_window.c
  3. 11
      src/window.c
  4. 3
      src/x11_window.c

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

Loading…
Cancel
Save