On Wed, Jan 30, 2008 at 07:29:58PM -0500, Brent Yorgey wrote:
Hi all!
This may end up being a long e-mail. Executive summary:
1. PerWorkspace is an inelegant hack with several icky problems:
- 'description' is not in the X monad so can't figure out the
current workspace
- the currently focused workspace might not even be the correct
one anyway, in the case of xinerama or message handling.
Bret,
perhaps there's something deeper I just don't get, but as far as I
understand your problem comes from the fact that you do not know in
which workspace you're handling a message.
This is a quite trivial patch that just gives you a method for that:
Thu Jan 31 13:42:23 CET 2008 Andrea Rossato
* Add handleMessageInWorkspace, a method that knows where to be
M ./XMonad/Core.hs +3
M ./XMonad/Operations.hs -2 +2
which adds:
handleMessageInWorkspace :: Workspace i (layout a) a -> SomeMessage -> X (Maybe (layout a))
as you see it is implemented on top of handleMessage, which means no
one would notice its introduction, but layout combinators may find
this method quite powerful.
Actually I'm not going to ask this patch to be included in the core,
I'm even opposing it: since the combinator class has gone, I'd
strongly discourage people from writing combinators on top of the
layout class. The code is mostly boilerplate buggy stuff, which will
just make you crazy when an API change is needed.
I had the idea of writing that class just because my class clean up
has been a nightmare just because of those combinators (well, David's
one are actually an example of clearness, and I used them to conceive
and develop the class).
But, as I said, probably I'm just missing something deeper I cannot
grasp.
Just my 2 cents,
Andrea