From 97c341ca238e1ce6b888556e339fd3ad1c88eb09 Mon Sep 17 00:00:00 2001 From: arturo Date: Wed, 10 Jul 2013 16:08:26 +0200 Subject: [PATCH] x11_window.c: fix _glfwPlatformGetWindowPos to include borders --- src/x11_window.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/x11_window.c b/src/x11_window.c index 72c79ab1..6e90303f 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -980,14 +980,18 @@ void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos) { Window child; int x, y; + int left, top; XTranslateCoordinates(_glfw.x11.display, window->x11.handle, _glfw.x11.root, 0, 0, &x, &y, &child); + XTranslateCoordinates(_glfw.x11.display, window->x11.handle, child, + 0, 0, &left, &top, &child); + if (xpos) *xpos = x; if (ypos) - *ypos = y; + *ypos = y-top; } void _glfwPlatformSetWindowPos(_GLFWwindow* window, int xpos, int ypos)