Add glfwGetMonitorWorkarea

From upstream: be295ccbea
This commit is contained in:
Kovid Goyal
2019-03-06 08:47:01 +05:30
parent db16996181
commit 0899019518
8 changed files with 86 additions and 0 deletions

16
glfw/x11_monitor.c vendored
View File

@@ -349,6 +349,22 @@ void _glfwPlatformGetMonitorContentScale(_GLFWmonitor* monitor,
*yscale = _glfw.x11.contentScaleY;
}
void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor* monitor, int* xpos, int* ypos, int *width, int *height)
{
if (_glfw.x11.randr.available && !_glfw.x11.randr.monitorBroken)
{
Atom* extents = NULL;
_glfwGetWindowPropertyX11(_glfw.x11.root, _glfw.x11.NET_WORKAREA, XA_CARDINAL, (unsigned char**) &extents);
*xpos = extents[0];
*ypos = extents[1];
*width = extents[2];
*height = extents[3];
XFree(extents);
}
}
GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* count)
{
GLFWvidmode* result;