This layout combinator is similar in spirit (and in code) to
the old combo combinator, but only allows two sublayouts. As
a result, we don't need to wrap these in existentials, and reading
works seamlessly. Also, we add the feature (which could also be
added to combo) of being able to change which sublayout a given
window is in through integration with WindowNavigation.
I envision combo being deprecated soon. combineTwo isn't quite
so flexible, but it's much easier and is better-coded also.
It seems that GHC 6.6 just enables -fglasgow-exts when it sees any LANGUAGE
pragma, so not all of them were added; this patch adds the rest of them, which
is necessary for xmonad to compile in GHC >=6.7.
This adds some type safety, since the super-layout is now of a distinct
type from the sublayouts. This avoids the ugliness we had, of passing
"fake" windows to the super layout. Now we directly lay out the layouts.
This modifies all the contrib modules to work (so far as I know) with the
new contrib layout. The exception is the LayoutHooks module, which isn't
used. It exports an API that is inherently unsafe, so far as I can tell
(and always has been).
WARNING! This change will break existing Tabbed configurations. The
problem is that there is no way within a Layout's "doLayout" to safely
modify the layout itself. This makes LayoutHooks fragile, and more to the
point, makes SimpleStacking fragile, so we can't safely define a
tabbed' = simpleStacking . tabbed
A workaround would have been to duplicate the tabbed code, but I'd rather
leave the ugliness and get this fixed.
Also uses fmap/maybe instead of do/case, which makes the code look a little
cleaner (imo).
Please note that I've only been able to test this briefly, but it seems to be
working like it's supposed to.
For some reason (not entirely clear to me) this doesn't work properly just
yet with the tabbed layout. :( But at least it'll compile. The trouble is
that we have no way of tracking which tab ought to be visible without
adding a *lot* of infrastructure. I'd rather have that infrastructure in
xmonad proper than reimplement all the focus-handling in combo, so for now
I'll just delay upgrading my xmonad at work...