diff --git a/source/Platform/Unix/X11Display.cpp b/source/Platform/Unix/X11Display.cpp index e8e5770..1f5144c 100644 --- a/source/Platform/Unix/X11Display.cpp +++ b/source/Platform/Unix/X11Display.cpp @@ -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)