diff options
author | David Roundy <droundy@darcs.net> | 2007-09-21 23:21:59 +0200 |
---|---|---|
committer | David Roundy <droundy@darcs.net> | 2007-09-21 23:21:59 +0200 |
commit | 85dc84516e3848ca9d9a268c121220de164d0e9e (patch) | |
tree | 4b498023867881b8e7392235b7e39037a292b2b1 /XMonad.hs | |
parent | 704ca55fc2de620d85929ca5cbcab5f2a03e77cc (diff) | |
download | metatile-85dc84516e3848ca9d9a268c121220de164d0e9e.tar metatile-85dc84516e3848ca9d9a268c121220de164d0e9e.zip |
add layout selection back into core xmonad using LayoutSelection.
This is just a reimplementation of LayoutChoice.
darcs-hash:20070921212159-72aca-870bb8d3e596fcb9edc48f51bec538054b4165e6
Diffstat (limited to 'XMonad.hs')
-rw-r--r-- | XMonad.hs | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -15,7 +15,7 @@ ----------------------------------------------------------------------------- module XMonad ( - X, WindowSet, WindowSpace, WorkspaceId, ScreenId(..), ScreenDetail(..), XState(..), XConf(..), Layout(..), SomeLayout(..), readLayout, + X, WindowSet, WindowSpace, WorkspaceId, ScreenId(..), ScreenDetail(..), XState(..), XConf(..), Layout(..), SomeLayout(..), ReadableSomeLayout(..), Typeable, Message, SomeMessage(..), fromMessage, runLayout, runX, catchX, io, catchIO, withDisplay, withWindowSet, isRoot, getAtom, spawn, restart, trace, whenJust, whenX, atom_WM_STATE, atom_WM_PROTOCOLS, atom_WM_DELETE_WINDOW @@ -132,6 +132,14 @@ atom_WM_STATE = getAtom "WM_STATE" -- data SomeLayout a = forall l. Layout l a => SomeLayout (l a) +class ReadableSomeLayout a where + defaults :: [SomeLayout a] +instance ReadableSomeLayout a => Read (SomeLayout a) where + readsPrec _ = readLayout defaults +instance ReadableSomeLayout a => Layout SomeLayout a where + doLayout (SomeLayout l) r s = fmap (fmap $ fmap SomeLayout) $ doLayout l r s + modifyLayout (SomeLayout l) = fmap (fmap SomeLayout) . modifyLayout l + instance Show (SomeLayout a) where show (SomeLayout l) = show l |