Move last bits of window setup to platform code

This avoids glfwCreateWindow emitting GLFW_FEATURE_UNAVAILABLE or
GLFW_FEATURE_UNIMPLEMENTED on Wayland because shared code was calling
unimplemented or unavailable platform functions during final setup.

It also makes it consistent with the final setup of full screen windows.
This commit is contained in:
Camilla Löwy
2022-04-06 21:13:48 +02:00
parent 72642ea0d1
commit 09653b8c54
7 changed files with 79 additions and 28 deletions
+18
View File
@@ -931,13 +931,31 @@ int _glfwCreateWindowCocoa(_GLFWwindow* window,
if (!_glfwCreateContextOSMesa(window, ctxconfig, fbconfig))
return GLFW_FALSE;
}
if (!_glfwRefreshContextAttribs(window, ctxconfig))
return GLFW_FALSE;
}
if (wndconfig->mousePassthrough)
_glfwSetWindowMousePassthroughCocoa(window, GLFW_TRUE);
if (window->monitor)
{
_glfwShowWindowCocoa(window);
_glfwFocusWindowCocoa(window);
acquireMonitor(window);
if (wndconfig->centerCursor)
_glfwCenterCursorInContentArea(window);
}
else
{
if (wndconfig->visible)
{
_glfwShowWindowCocoa(window);
if (wndconfig->focused)
_glfwFocusWindowCocoa(window);
}
}
return GLFW_TRUE;