1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-11-23 10:48:51 -05:00

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) was set to `GLFW_DONT_CARE` (#805)
- [X11] Bugfix: Input focus was set before window was visible, causing - [X11] Bugfix: Input focus was set before window was visible, causing
`BadMatch` on some non-reparenting WMs (#789,#798) `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 - [WGL] Added reporting of errors from `WGL_ARB_create_context` extension
- [GLX] Bugfix: Dynamically loaded entry points were not verified - [GLX] Bugfix: Dynamically loaded entry points were not verified
- [EGL] Added `lib` prefix matching between EGL and OpenGL ES library binaries - [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); XSetWMNormalHints(_glfw.x11.display, window->x11.handle, hints);
XFree(hints); XFree(hints);
} }
@ -1712,21 +1715,11 @@ void _glfwPlatformSetWindowIcon(_GLFWwindow* window,
void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos) void _glfwPlatformGetWindowPos(_GLFWwindow* window, int* xpos, int* ypos)
{ {
Window child; Window dummy;
int x, y; int x, y;
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, &dummy);
if (child)
{
int left, top;
XTranslateCoordinates(_glfw.x11.display, window->x11.handle, child,
0, 0, &left, &top, &child);
x -= left;
y -= top;
}
if (xpos) if (xpos)
*xpos = x; *xpos = x;