[Xmonad] darcs patch: support self-modifying layouts.

David Roundy droundy at darcs.net
Sat Jun 23 17:15:59 EDT 2007


Hi all,

Here's a patch to support self-modifying Layouts.  The problem with the
previous API was that there was no safe way to write a self-modifying
layout, since there was no way for the layout to determine where (if
anywhere) it was located in XState (or anywhere else).  This patch makes
doLayout return a (Maybe (Layout a)) which is treated as the modified
version of the Layout if it's not Nothing.

This isn't an ideal API, since it relies on the caller of doLayout checking
its return value, and acting on it appropriately.  But I don't know of a
better way to do this, and at least this works.  And since we won't have
many Layouts in core, it shouldn't be hard to keep core bug-free, and
LayoutHelpers has some code for assisting in writing layout modifiers.  The
really ugly stuff is in Decorations, where we return a Layout modifier and
rely on our caller to make use of it.  :( It seems like we really need some
sort of a Layout monad, but I'm too tired to think more about this just
now.

Patches to XMonadContrib to follow...

David

Sat Jun 23 13:14:47 PDT 2007  David Roundy <droundy at darcs.net>
  * support self-modifying layouts.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/x-darcs-patch
Size: 17741 bytes
Desc: A darcs patch for your repository!
Url : http://www.haskell.org/pipermail/xmonad/attachments/20070623/55cff11f/attachment.bin


More information about the Xmonad mailing list