1
0
Fork 0

source/Platform/Unix/X11Display.cpp: make getSize() query X11 and dont just return cached value.

This commit is contained in:
Henrik Hautakoski 2023-08-02 05:19:15 +02:00
parent 8ff2a3d37f
commit 57d4e44bbe

View file

@ -126,7 +126,20 @@ void X11Display::setSize(unsigned int width, unsigned int height)
Vector2u X11Display::getSize() const
{
return m_size;
int x, y;
unsigned int w, h, bw, d;
::Display* disp = Xlib::getDisplay();
::Window ancestor = m_win;
::Window root = DefaultRootWindow(disp);
while (Xlib::getParentWindow(ancestor) != root) {
// Next window up (parent window).
ancestor = Xlib::getParentWindow(ancestor);
}
::XGetGeometry(disp, ancestor, &root, &x, &y, &w, &h, &bw, &d);
return Vector2u(w, h);
}
void X11Display::setPosition(unsigned int x, unsigned int y)