X11: Fix glfw*WindowPos operating on window frame

Fixes #800.
This commit is contained in:
Camilla Berglund 2016-08-17 01:11:32 +02:00
parent c18d3aecbc
commit 4aafdea5a7
2 changed files with 7 additions and 12 deletions

View File

@ -117,6 +117,8 @@ information on what to include when reporting a bug.
was set to `GLFW_DONT_CARE` (#805)
- [X11] Bugfix: Input focus was set before window was visible, causing
`BadMatch` on some non-reparenting WMs (#789,#798)
- [X11] Bugfix: `glfwGetWindowPos` and `glfwSetWindowPos` operated on the
window frame instead of the client area (#800)
- [WGL] Added reporting of errors from `WGL_ARB_create_context` extension
- [GLX] Bugfix: Dynamically loaded entry points were not verified
- [EGL] Added `lib` prefix matching between EGL and OpenGL ES library binaries

View File

@ -289,6 +289,9 @@ static void updateNormalHints(_GLFWwindow* window, int width, int height)
}
}
hints->flags |= PWinGravity;
hints->win_gravity = StaticGravity;
XSetWMNormalHints(_glfw.x11.display, window->x11.handle, hints);
XFree(hints);
}
@ -1712,21 +1715,11 @@ void _glfwPlatformSetWindowIcon(_GLFWwindow* window,
void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos)
{
Window child;
Window dummy;
int x, y;
XTranslateCoordinates(_glfw.x11.display, window->x11.handle, _glfw.x11.root,
0, 0, &x, &y, &child);
if (child)
{
int left, top;
XTranslateCoordinates(_glfw.x11.display, window->x11.handle, child,
0, 0, &left, &top, &child);
x -= left;
y -= top;
}
0, 0, &x, &y, &dummy);
if (xpos)
*xpos = x;