mirror of
https://github.com/glfw/glfw.git
synced 2026-01-11 15:23:17 +01:00
Add glfwGetMonitorWorkarea
This function retrieves the work area rectangle of the specified monitor. Related to #920. Closes #989.
This commit is contained in:
committed by
Camilla Löwy
parent
c20754c4a6
commit
be295ccbea
@@ -408,6 +408,24 @@ void _glfwPlatformGetMonitorContentScale(_GLFWmonitor* monitor,
|
||||
*yscale = (float) (pixels.size.height / points.size.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)
|
||||
{
|
||||
CFArrayRef modes;
|
||||
|
||||
Reference in New Issue
Block a user