[Xmonad] moving layouts to Workspace

Spencer Janssen sjanssen at cse.unl.edu
Wed Sep 5 15:42:10 EDT 2007


On Monday 20 August 2007 20:17:45 David Roundy wrote:
> Hi all,
>
> I've been thinking that we'd be better off if the contents of layouts were
> moved to Workspace, something like
>
> data Workspace i l a = Workspace  { tag :: !i, layouts :: (l a,[l a]),
> stack :: StackOrNot a } deriving (Show, Read, Eq)
>
> Thus the layout for each workspace would be stored with that workspace.
> This seems cleaner than the current approach of using a Data.Map.Map to
> figure out what the layout is for each workspace, since the data type would
> enforce that a layout exists for each workspace, rather than relying on an
> invarient that each workspace must have an entry in the map (an invarient I
> broke while writing DynamicWorkspaces, embarassingly crashing xmonad).
>
> This change would be pretty .  We just need to think of a way to serialize
layouts first (another thing that should happen for 0.4).
> like a good idea.  Personally, I think it'll be far more beautiful.  There
> *are* bits of code that'll get trickier (e.g. Operations.broadcastMessage).
> But in my mind any such complexities are outweighed by the greater
> modularity, that one can modify a Workspace in isolation--and in a way that
> doesn't cause xmonad to crash when the workspace ids get out of sync with
> the contents of the Data.Map layouts.

Yes, we should do this for 0.4.  We need to figure out how to serialize
layouts first (which is another thing that should happen for 0.4).


Cheers,
Spencer Janssen



More information about the Xmonad mailing list