summaryrefslogtreecommitdiffstats
path: root/XMonad.hs
diff options
context:
space:
mode:
authorDavid Roundy <droundy@darcs.net>2007-09-21 23:21:59 +0200
committerDavid Roundy <droundy@darcs.net>2007-09-21 23:21:59 +0200
commit85dc84516e3848ca9d9a268c121220de164d0e9e (patch)
tree4b498023867881b8e7392235b7e39037a292b2b1 /XMonad.hs
parent704ca55fc2de620d85929ca5cbcab5f2a03e77cc (diff)
downloadmetatile-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.hs10
1 files changed, 9 insertions, 1 deletions
diff --git a/XMonad.hs b/XMonad.hs
index f288469..3a6f298 100644
--- a/XMonad.hs
+++ b/XMonad.hs
@@ -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