mirror of
https://github.com/glfw/glfw.git
synced 2025-10-04 21:56:36 +00:00
Cocoa fix for _glfwPlatformGetMonitorWorkarea
This commit is contained in:
parent
e4ec9500cf
commit
825e31d0dd
@ -374,13 +374,7 @@ void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor* monitor, int* xpos, int* ypos
|
|||||||
NSScreen *resultScreen;
|
NSScreen *resultScreen;
|
||||||
for (NSScreen *screen in [NSScreen screens]) {
|
for (NSScreen *screen in [NSScreen screens]) {
|
||||||
if ([[[screen deviceDescription] valueForKey:@"NSScreenNumber"] intValue] == monitor->ns.displayID) {
|
if ([[[screen deviceDescription] valueForKey:@"NSScreenNumber"] intValue] == monitor->ns.displayID) {
|
||||||
resultScreen = screen;
|
NSRect frameRect = [screen visibleFrame];
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
NSRect frameRect = [[NSScreen resultScreen] visibleFrame];
|
|
||||||
|
|
||||||
if (xpos)
|
if (xpos)
|
||||||
*xpos = NSMinX(frameRect);
|
*xpos = NSMinX(frameRect);
|
||||||
if (ypos)
|
if (ypos)
|
||||||
@ -389,6 +383,9 @@ void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor* monitor, int* xpos, int* ypos
|
|||||||
*width = NSWidth(frameRect);
|
*width = NSWidth(frameRect);
|
||||||
if (height)
|
if (height)
|
||||||
*height = NSHeight(frameRect);
|
*height = NSHeight(frameRect);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void _glfwPlatformGetMonitorContentScale(_GLFWmonitor* monitor,
|
void _glfwPlatformGetMonitorContentScale(_GLFWmonitor* monitor,
|
||||||
|
Loading…
Reference in New Issue
Block a user