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 | 365e1400645e970fe1d4d07401235a9bf044dbb9 (patch) | |
tree | 4b498023867881b8e7392235b7e39037a292b2b1 /XMonad.hs | |
parent | b7aaefbace2867206bd77f19660f7ae6c628fdb5 (diff) | |
download | xmonad-365e1400645e970fe1d4d07401235a9bf044dbb9.tar.gz xmonad-365e1400645e970fe1d4d07401235a9bf044dbb9.tar.xz xmonad-365e1400645e970fe1d4d07401235a9bf044dbb9.zip |
add layout selection back into core xmonad using LayoutSelection.
This is just a reimplementation of LayoutChoice.
darcs-hash:20070921212159-72aca-870bb8d3e596fcb9edc48f51bec538054b4165e6.gz
Diffstat (limited to '')
-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 |