[Xmonad] darcs patch: STRUT aware gap toggling (clean patch)

David Roundy droundy at darcs.net
Tue Oct 23 17:32:42 EDT 2007

On Tue, Oct 23, 2007 at 07:15:22PM +0200, Joachim Breitner wrote:
> Am Dienstag, den 23.10.2007, 10:04 -0400 schrieb David Roundy:
> > On Tue, Oct 23, 2007 at 12:06:57AM +0200, mail at joachim-breitner.de wrote:
> > > Tue Oct 23 00:01:32 CEST 2007  mail at joachim-breitner.de
> > >   * STRUT aware gap toggling (clean patch)
> > >   
> > >   Without this patch, ManageDocks would only set the gap according to a window???s
> > >   STRUT when the window is first mapped. This information would then get lost when
> > >   the user toggle the gap.
> > >      
> > >   Now, when the user toggles the Gap, all present windows are scanned for STRUT
> > >   settings, and the gap is set accordingly. No need to manually configure the gap
> > >   anymore.
> > >   
> > >   This is the same patch as before, but independant of the Hooks patches, and with
> > >   more documentation.
> > 
> > This sounds nice, but I wonder:  why use the gaps at all? They were
> > introduced as a hack to allow status bars to remain visible, but why not
> > simply introduce a layout modifier (which alas, couldn't be implemented
> > with the LayoutModifier interface) that automatically adjusts the bounding
> > rectangle to avoid struts?
> > 
> > (I've obviously been longing to eliminate the ugly gaps from our data
> > structures...)
> Thanks for applying. I haven’t done anything with Layouts yet, so I
> didn’t think of that but sure, if it’s possible then it could be done
> this way.

Do you have any reason to believe this code will crash on 64 operating
systems? That's been my experience.  It consistently crashes xmonad, which
makes it rather unpleasant to deal with.  Could this have to do with all
the Word32s that are floating around? (Just a naive guess.)

In any case, I've got a bit of sketchy code, which looks fine except for
the fact than none of this strut business works at all on my computer.  I
could try on my laptop, which is 32 bit, perhaps.  For now, I'll send in an
untested patch, which you could (if you like) try out.  If calcGaps can be
considered fast, we should be able to have automatic strut-avoidance by
simply inserting an "avoidStruts $ " into the layoutHook.  Toggling this
avoidance will require a very small amount more code (just receiving a
custom message).
David Roundy
Department of Physics
Oregon State University

More information about the Xmonad mailing list