source/Platform/Unix/X11Display.cpp: make getSize() query X11 and dont just return cached value.
This commit is contained in:
parent
8ff2a3d37f
commit
57d4e44bbe
1 changed files with 14 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue