mirror of
https://github.com/glfw/glfw.git
synced 2026-09-18 14:45:46 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user