mirror of
https://github.com/glfw/glfw.git
synced 2026-09-17 22:32:50 +00:00
Fixed window position being incorrect on some WMs.
This commit is contained in:
@@ -985,6 +985,17 @@ void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos)
|
||||
XTranslateCoordinates(_glfw.x11.display, window->x11.handle, _glfw.x11.root,
|
||||
0, 0, &x, &y, &child);
|
||||
|
||||
if (child != None)
|
||||
{
|
||||
int left, top;
|
||||
|
||||
XTranslateCoordinates(_glfw.x11.display, window->x11.handle, child,
|
||||
0, 0, &left, &top, &child);
|
||||
|
||||
x -= left;
|
||||
y -= top;
|
||||
}
|
||||
|
||||
if (xpos)
|
||||
*xpos = x;
|
||||
if (ypos)
|
||||
|
||||
Reference in New Issue
Block a user