[Xcb] how to get window dimensions?

Cosmin Apreutesei cosmin.apreutesei at gmail.com
Fri Jul 3 02:30:38 PDT 2015


Is there a reliable way to get the inner and outer rectangle of a top
level window? (IOW frame and client rectangle).

Here's what I tried:

- xcb_get_geometry always returns the initial dimensions even after
the window gets resized (what gives?)

- I figured I would call xcb_query_tree repeatedly until I find the
window's frame window - is this the way to do it? I figure ICCCM/EWMH
should provide this but couldn't find anything. Is there any other
standard/non-standard for this? Anyway that doesn't work with
compiz/ubuntu10 because xcb_query_tree reports the client window as
having root = parent (under normal ubuntu wm the window gets properly

- xcb_translate_coordinates() seemed to be the only reliable way to
get root-based coords[1] in 2007 -- is this still the case? I.e. is
XCB_CONFIGURE_NOTIFY non-standard with WMs?

[sorry if this is not a xcb specific question, should I post this to
xorg instead? I'll plow my way though wxwidgets, qt, pyglet in the
meantime to find an answer]

[1] http://fixunix.com/xwindows/91652-finding-position-top-level-windows.html

More information about the Xcb mailing list