[Xcb] how to get window dimensions?

Sam Varshavchik mrsam at courier-mta.com
Fri Jul 3 05:06:12 PDT 2015


Cosmin Apreutesei writes:

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

A window manager is not required to implement the entire frame as a single  
parent window of the application window. For example, a window manager could  
create four windows, one for each side of the application window, and render  
its decorations in the four windows.

>
> 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
> reparented).

xcb_ewmh_get_frame_extents().

This gives you the size of each window manager border's decorations. From  
that, you can compute the rest.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/xcb/attachments/20150703/02a81d99/attachment.sig>


More information about the Xcb mailing list