Re: Alignment of multiple top-level windows



On Thu, 2005-12-29 at 05:09 +1100, Russell Shaw wrote:
> Hi,
> How can i enforce the relative arrangement of multiple top-level
> X windows in an ICCCM compliant way? I want this arrangement of
> three windows on startup:

You have to first map the menubar and wait for the WM to set the
_NET_FRAME_EXTENTS property (you must synchronously block until the
menubar is shown). Then you can read the position and frame extents of
the menubar. Position the panel based on that, and again synchronously
block to see where the WM puts it and how large the frame is. With these
numbers you can then position the work area. The user will see the three
windows map one, two, three instead of all at once; there's no way I
know of to avoid that because if you don't synchronously wait for the
windows to map, you will have a race condition where you might read the
position or frame extents prior to them being set to their final values.
gtk_widget_show_now() is probably good enough for blocking
synchronously. I don't remember if there's a gdk call for getting frame
extents.

If you do the above, newer WMs that support _NET_FRAME_EXTENTS and that
have "typical" window placement policies will work. Older ICCCM-only
WMs, and more unusual WMs, will not work. There's no sane way to do this
with ICCCM only, you need the newer _NET_FRAME_EXTENTS property.

Havoc


> +----------------------------------------------------+
> |                      Menubar                       |
> +----------------------------------------------------+
> +-----+ +--------------------------------------------+
> |     | |                                            |
> |  P  | |                                            |
> |  a  | |                                            |
> |  n  | |           Work area                        |
> |  e  | |                                            |
> |  l  | |                                            |
> |     | |                                            |
> |     | |                                            |
> |     | |                                            |
> |     | |                                            |
> |     | |                                            |
> |     | |                                            |
> |     | |                                            |
> |     | |                                            |
> +-----+ +--------------------------------------------+





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]