Partially support _NET_WM_STRUT_PARTIAL.
commit930e59dd3142a4ceba46826183e13d67b420e3de
authorIain Patterson <wm@iain.cx>
Fri, 26 Oct 2012 18:40:55 +0000 (26 11:40 -0700)
committerCarlos R. Mafra <crmafra@gmail.com>
Sun, 28 Oct 2012 10:58:43 +0000 (28 10:58 +0000)
treed59a134e70fa92e9ab765c0943d8035380d22342
parent45c5145ff2ba491473294c590fb7f380d6968dba
Partially support _NET_WM_STRUT_PARTIAL.

Window Maker already supports the _NET_WM_STRUT property as described
in the EWMH spec.  We respect client-provided struts and avoid placing
or maximizing windows over those areas.  An example is that we don't
try to place or maximize windows where they would be obscured by an
always-on-top gnome-panel.

_NET_WM_STRUT is now deprecated and redefined as a special case of
_NET_WM_STRUT_PARTIAL, which allows variable strut widths.  A panel at
the bottom of the screen, for example, does not have to reserve the
whole width as a strut if it does not fill 100% of the screen width.
By default the XFCE bottom panel does not extend the whole width of
the screen, for instance.

Our method for restricting parts of the screen from placement doesn't
have a way to account for struts which are not 100% tall or 100% wide,
so until now we have ignored partial struts.  In the case of the XFCE
panel mentioned above, the result is that a window may maximize
underneath the panel and be obscured.

As a partial hackaround we now query windows for _NET_WM_STRUT_PARTIAL
but throw away the start and end co-ordinates, assuming instead that
the struts are full-width/full-height.  This trades off a small amount
of wasted placement space to avoid the case where windows can be
partially obscured by panels, which can be particularly annoying if
the panel is at the top and the victim's titlebar becomes hidden.
src/wmspec.c