[xmonad] Toggle window decoration

Norbert Zeh nzeh at cs.dal.ca
Sun Feb 5 03:35:52 CET 2012


Norbert Zeh [2012.02.04 1606 -0400]:
> Brandon Allbery [2012.02.04 1449 -0500]:
> > On Sat, Feb 4, 2012 at 14:35, Norbert Zeh <nzeh at cs.dal.ca> wrote:
> > 
> >     Brandon Allbery [2012.02.04 1425 -0500]:
> >     > XMonad.Layout.MultiToggle
> >     > One of the standard modifier toggles turns server-side borders on/off
> >     > dynamically; you should be able to use the provided examples to work out
> >     how to
> >     > toggle a Decorations-based modifier.
> > 
> >     Cried hurray too quickly.  MultiToggle seems to operate on entire layouts.
> >      If I
> >     have, say, 4 windows on a decorated layout, what I'd like to do is leave 3
> >     of
> >     them decorated, while removing the decoration from only one of the windows.
> >      By
> > 
> > 
> > Ah.  That'd be harder, yes, although  think it's doable; take a look at
> > XMonad.Layout.Decoration.
> >  
> > 
> >     "decoration", I don't mean borders.  I mean the title bar added by
> > 
> > 
> > Right.  Most (all?) of those are based on XMonad.Layout.Decoration.
> 
> Indeed.  My idea of implementing this, though, was not to implement a new
> decoration based on the framework provided by X.L.Decoration but to provide a
> general layout modifier that allows me to toggle the decorations added by any
> X.L.Decoration-based layout modifier.  I was thinking about storing the windows
> that currently shouldn't have decoration in ExtensibleState.  Then, I'd have to
> see how X.L.Decoration implements the addition of the tabs/titlebars.  I would
> suspect it takes the rectangles provided by the underlying layout, shrinks them
> to make room for the title bar, and draws the title bar.  If I can somehow hook
> in my modifier as an intermediary that invokes the underlying layout, puts the
> windows that should not be decorated aside, passes the remaining windows to the
> decoration modifier, and finally puts all together, that would be ideal.  I'll
> have to think a bit about how to do this cleanly.  For now, I just wanted to
> know whether what I want can already be done essentially out of the box using
> some existing modules.  Seems like the answer is no.

Alright.  Got something working.  It's still a bit rough around the edges and
needs some testing, and it also isn't quite as general as I would have liked.
So I'll keep tinkering for a while, but at least it seems to do exactly what I
initially stated I wanted.  In the end, I actually ended up providing what
essentially amounts to a DecorationModifier, wrapped in a LayoutModifier in
order to receive messages the Decoration layout modifier does not handle.  Ugh,
but it was the cleanest solution I was able to come up with, given the way
decorations are currently implemented.

Cheers,
Norbert




More information about the xmonad mailing list