mirror of
https://github.com/glfw/glfw.git
synced 2025-10-05 06:06:36 +00:00
Implementation for querying work area with Cocoa
This is an initial implementation and needs review.
This commit is contained in:
parent
a24fdf27f9
commit
f539f19b58
@ -362,6 +362,20 @@ void _glfwPlatformGetMonitorPos(_GLFWmonitor* monitor, int* xpos, int* ypos)
|
|||||||
|
|
||||||
void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor* monitor, int* xpos, int* ypos, int *width, int *height)
|
void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor* monitor, int* xpos, int* ypos, int *width, int *height)
|
||||||
{
|
{
|
||||||
|
NSScreen *resultScreen;
|
||||||
|
for (NSScreen *screen in [NSScreen screens]) {
|
||||||
|
if ([[[screen deviceDescription] valueForKey:@"NSScreenNumber"] intValue] == monitor->ns.displayID) {
|
||||||
|
resultScreen = screen;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
NSRect frameRect = [[NSScreen resultScreen] visibleFrame];
|
||||||
|
|
||||||
|
*xpos = NSMinX(frameRect)
|
||||||
|
*ypos = NSMinY(frameRect)
|
||||||
|
*width = NSMaxX(frameRect)
|
||||||
|
*height = NSMaxY(frameRect)
|
||||||
}
|
}
|
||||||
|
|
||||||
GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* count)
|
GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* count)
|
||||||
|
Loading…
Reference in New Issue
Block a user