Fixed Window::getPosition() on Linux (#346)
This commit is contained in:
parent
68b51734a9
commit
ebaad339a9
@ -285,9 +285,14 @@ void WindowImplX11::processEvents()
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
Vector2i WindowImplX11::getPosition() const
|
Vector2i WindowImplX11::getPosition() const
|
||||||
{
|
{
|
||||||
XWindowAttributes attributes;
|
::Window root, child;
|
||||||
XGetWindowAttributes(m_display, m_window, &attributes);
|
int localX, localY, x, y;
|
||||||
return Vector2i(attributes.x, attributes.y);
|
unsigned int width, height, border, depth;
|
||||||
|
|
||||||
|
XGetGeometry(m_display, m_window, &root, &localX, &localY, &width, &height, &border, &depth);
|
||||||
|
XTranslateCoordinates(m_display, m_window, root, localX, localY, &x, &y, &child);
|
||||||
|
|
||||||
|
return Vector2i(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user