mirror of
https://github.com/glfw/glfw.git
synced 2026-09-21 00:30:57 +00:00
+3
-1
@@ -410,7 +410,9 @@ void _glfwPlatformGetMonitorContentScale(_GLFWmonitor* monitor,
|
||||
*yscale = (float) (pixels.size.height / points.size.height);
|
||||
}
|
||||
|
||||
void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor* monitor, int* xpos, int* ypos, int *width, int *height)
|
||||
void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor* monitor,
|
||||
int* xpos, int* ypos,
|
||||
int* width, int* height)
|
||||
{
|
||||
if (!refreshMonitorScreen(monitor))
|
||||
return;
|
||||
|
||||
+3
-1
@@ -330,7 +330,9 @@ GLFWAPI void glfwGetMonitorPos(GLFWmonitor* handle, int* xpos, int* ypos)
|
||||
_glfwPlatformGetMonitorPos(monitor, xpos, ypos);
|
||||
}
|
||||
|
||||
GLFWAPI void glfwGetMonitorWorkarea(GLFWmonitor* handle, int* xpos, int* ypos, int* width, int* height)
|
||||
GLFWAPI void glfwGetMonitorWorkarea(GLFWmonitor* handle,
|
||||
int* xpos, int* ypos,
|
||||
int* width, int* height)
|
||||
{
|
||||
_GLFWmonitor* monitor = (_GLFWmonitor*) handle;
|
||||
assert(monitor != NULL);
|
||||
|
||||
+3
-1
@@ -49,7 +49,9 @@ void _glfwPlatformGetMonitorContentScale(_GLFWmonitor* monitor,
|
||||
*yscale = 1.f;
|
||||
}
|
||||
|
||||
void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor* monitor, int* xpos, int* ypos, int *width, int *height)
|
||||
void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor* monitor,
|
||||
int* xpos, int* ypos,
|
||||
int* width, int* height)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
+8
-6
@@ -361,28 +361,30 @@ void _glfwPlatformGetMonitorContentScale(_GLFWmonitor* monitor,
|
||||
_glfwGetMonitorContentScaleWin32(monitor->win32.handle, xscale, yscale);
|
||||
}
|
||||
|
||||
void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor* monitor, int* xpos, int* ypos, int *width, int *height)
|
||||
void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor* monitor,
|
||||
int* xpos, int* ypos,
|
||||
int* width, int* height)
|
||||
{
|
||||
MONITORINFO monitorInfo;
|
||||
int x, y;
|
||||
POINT pointInMonitor;
|
||||
HMONITOR hMonitor;
|
||||
|
||||
_glfwPlatformGetMonitorPos( monitor, &x, &y );
|
||||
_glfwPlatformGetMonitorPos(monitor, &x, &y);
|
||||
|
||||
monitorInfo.cbSize = sizeof(MONITORINFO);
|
||||
pointInMonitor.x = x + 1;
|
||||
pointInMonitor.y = y + 1;
|
||||
|
||||
hMonitor = MonitorFromPoint( pointInMonitor, 0 );
|
||||
hMonitor = MonitorFromPoint(pointInMonitor, 0);
|
||||
GetMonitorInfo(hMonitor, &monitorInfo);
|
||||
|
||||
if (xpos)
|
||||
*xpos = monitorInfo.rcWork.left;
|
||||
*xpos = monitorInfo.rcWork.left;
|
||||
if (ypos)
|
||||
*ypos = monitorInfo.rcWork.top;
|
||||
*ypos = monitorInfo.rcWork.top;
|
||||
if (width)
|
||||
*width = monitorInfo.rcWork.right - monitorInfo.rcWork.left;
|
||||
*width = monitorInfo.rcWork.right - monitorInfo.rcWork.left;
|
||||
if (height)
|
||||
*height = monitorInfo.rcWork.bottom - monitorInfo.rcWork.top;
|
||||
}
|
||||
|
||||
+3
-1
@@ -170,7 +170,9 @@ void _glfwPlatformGetMonitorContentScale(_GLFWmonitor* monitor,
|
||||
*yscale = (float) monitor->wl.scale;
|
||||
}
|
||||
|
||||
void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor* monitor, int* xpos, int* ypos, int *width, int *height)
|
||||
void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor* monitor,
|
||||
int* xpos, int* ypos,
|
||||
int* width, int* height)
|
||||
{
|
||||
if (xpos)
|
||||
*xpos = monitor->wl.x;
|
||||
|
||||
+4
-2
@@ -342,13 +342,15 @@ void _glfwPlatformGetMonitorContentScale(_GLFWmonitor* monitor,
|
||||
*yscale = _glfw.x11.contentScaleY;
|
||||
}
|
||||
|
||||
void _glfwPlatformGetMonitorWorkarea(_GLFWmonitor* monitor, int* xpos, int* ypos, int *width, int *height)
|
||||
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);
|
||||
_glfwGetWindowPropertyX11(_glfw.x11.root,
|
||||
_glfw.x11.NET_WORKAREA, XA_CARDINAL,
|
||||
(unsigned char**) &extents);
|
||||
|
||||
if (xpos)
|
||||
*xpos = extents[0];
|
||||
|
||||
Reference in New Issue
Block a user