Cocoa: Add work area NULL checks and fix size

Related to #1322.
This commit is contained in:
Doug Binks 2018-09-08 18:00:44 +02:00 committed by Camilla Löwy
parent bea4818030
commit 222ac78a44

View File

@ -420,10 +420,14 @@ void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor* monitor, int* xpos, int* ypos
NSRect frameRect = [[NSScreen resultScreen] visibleFrame]; NSRect frameRect = [[NSScreen resultScreen] visibleFrame];
if (xpos)
*xpos = NSMinX(frameRect); *xpos = NSMinX(frameRect);
if (ypos)
*ypos = NSMinY(frameRect); *ypos = NSMinY(frameRect);
*width = NSMaxX(frameRect); if (width)
*height = NSMaxY(frameRect); *width = NSWidth(frameRect);
if (height)
*height = NSHeight(frameRect);
} }
GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* count) GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* count)