mirror of
https://github.com/glfw/glfw.git
synced 2025-06-15 12:12:16 +00:00
x11_window.c: fix _glfwPlatformGetWindowPos to include borders
This commit is contained in:
parent
0e12fb869c
commit
97c341ca23
@ -980,14 +980,18 @@ void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos)
|
|||||||
{
|
{
|
||||||
Window child;
|
Window child;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
int left, top;
|
||||||
|
|
||||||
XTranslateCoordinates(_glfw.x11.display, window->x11.handle, _glfw.x11.root,
|
XTranslateCoordinates(_glfw.x11.display, window->x11.handle, _glfw.x11.root,
|
||||||
0, 0, &x, &y, &child);
|
0, 0, &x, &y, &child);
|
||||||
|
|
||||||
|
XTranslateCoordinates(_glfw.x11.display, window->x11.handle, child,
|
||||||
|
0, 0, &left, &top, &child);
|
||||||
|
|
||||||
if (xpos)
|
if (xpos)
|
||||||
*xpos = x;
|
*xpos = x;
|
||||||
if (ypos)
|
if (ypos)
|
||||||
*ypos = y;
|
*ypos = y-top;
|
||||||
}
|
}
|
||||||
|
|
||||||
void _glfwPlatformSetWindowPos(_GLFWwindow* window, int xpos, int ypos)
|
void _glfwPlatformSetWindowPos(_GLFWwindow* window, int xpos, int ypos)
|
||||||
|
Loading…
Reference in New Issue
Block a user