mirror of
https://github.com/glfw/glfw.git
synced 2026-09-21 16:44:11 +00:00
Cleanup
Allow window creation despite video mode setting failure. Video mode setting failure is ignored the rest of the time and the desired video mode has never been a hard constraint anyway.
This commit is contained in:
+3
-5
@@ -138,9 +138,9 @@ static float transformY(float y)
|
||||
|
||||
// Make the specified window and its video mode active on its monitor
|
||||
//
|
||||
static GLFWbool acquireMonitor(_GLFWwindow* window)
|
||||
static void acquireMonitor(_GLFWwindow* window)
|
||||
{
|
||||
const GLFWbool status = _glfwSetVideoModeNS(window->monitor, &window->videoMode);
|
||||
_glfwSetVideoModeNS(window->monitor, &window->videoMode);
|
||||
const CGRect bounds = CGDisplayBounds(window->monitor->ns.displayID);
|
||||
const NSRect frame = NSMakeRect(bounds.origin.x,
|
||||
transformY(bounds.origin.y + bounds.size.height),
|
||||
@@ -150,7 +150,6 @@ static GLFWbool acquireMonitor(_GLFWwindow* window)
|
||||
[window->ns.object setFrame:frame display:YES];
|
||||
|
||||
_glfwInputMonitorWindow(window->monitor, window);
|
||||
return status;
|
||||
}
|
||||
|
||||
// Remove the window and restore the original video mode
|
||||
@@ -1178,8 +1177,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
||||
{
|
||||
_glfwPlatformShowWindow(window);
|
||||
_glfwPlatformFocusWindow(window);
|
||||
if (!acquireMonitor(window))
|
||||
return GLFW_FALSE;
|
||||
acquireMonitor(window);
|
||||
|
||||
if (wndconfig->centerCursor)
|
||||
centerCursor(window);
|
||||
|
||||
Reference in New Issue
Block a user