[Xmonad] darcs patch: Added LayoutMessages

David Roundy droundy at darcs.net
Mon Sep 24 13:20:38 EDT 2007


On Mon, Sep 24, 2007 at 06:32:40PM +0200, Andrea Rossato wrote:
> On Mon, Sep 24, 2007 at 06:19:06PM +0200, Andrea Rossato wrote:
> > A layout must respond at least to 3 events:
> >   1. a change in the stack -> UnDoLayout
> 
> UnDoLayout, which is actually useless, since we call doLayout within
> Operations.windows, right?

Right, which brings us down to 2.

> >   2. a change in visibility:
> >        A. workspace got hidden
> >        B. LayoutSwitch -> the layout is not reachable anymore
> 
> Still, if we cannot use Hide for both, so we free the resources in
> case of a layout switch. Right?

I don't see why "workspace got hidden" and LayoutSwitch differ.  In both
cases, the layout may later be reachable, and may not later be reachable.

As long as we have a separate ReleaseResources message, I don't see why 2.A
and 2.B shouldn't use the same message.  Or more to the point, I don't see
why we'd ever do anything differently, depending on which of these two
events we received.

I think we definitely need the ReleaseResources message for restarting or
exiting xmonad, and for in cases where we end up discarding a Layout (due
to either not wanting the layout any longer, or perhaps not wanting a
Workspace any longer).

If we wanted, we could combine "workspace/layout got hidden/deselected"
with ReleaseResources, which would give layouts less flexibility to cache
interesting resources, but I don't think I'd vote for this (although it was
previously my preference).  I agree that there can be cached data that is
worth keeping around, so two messages seems optimal to me.
-- 
David Roundy
Department of Physics
Oregon State University


More information about the Xmonad mailing list