diff options
author | Ilya Portnov <portnov84@rambler.ru> | 2011-05-14 15:25:49 +0200 |
---|---|---|
committer | Ilya Portnov <portnov84@rambler.ru> | 2011-05-14 15:25:49 +0200 |
commit | d2d1294856f855ed492ad3cdba9013333689cb8a (patch) | |
tree | 97151a1b8fa10fc50a8198caa87e87448c8cf348 | |
parent | fa5866e9c288d4079de26953a616ecf7e2f295ac (diff) | |
download | XMonadContrib-d2d1294856f855ed492ad3cdba9013333689cb8a.tar.gz XMonadContrib-d2d1294856f855ed492ad3cdba9013333689cb8a.tar.xz XMonadContrib-d2d1294856f855ed492ad3cdba9013333689cb8a.zip |
Generalize X.L.AutoMaster modifier
Ignore-this: 481c35dd721405bab8b085c45cb983ce
Enable it to work not only with Windows, but with any (Eq) type.
darcs-hash:20110514132549-c5067-fe26b23224c3be42c2374286f8b531e84a928aa5.gz
-rw-r--r-- | XMonad/Layout/AutoMaster.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/XMonad/Layout/AutoMaster.hs b/XMonad/Layout/AutoMaster.hs index 7a912c8..c393bd0 100644 --- a/XMonad/Layout/AutoMaster.hs +++ b/XMonad/Layout/AutoMaster.hs @@ -48,7 +48,7 @@ import XMonad.Layout.LayoutModifier data AutoMaster a = AutoMaster Int Float Float deriving (Read,Show) -instance LayoutModifier AutoMaster Window where +instance (Eq w) => LayoutModifier AutoMaster w where modifyLayout (AutoMaster k bias _) = autoLayout k bias pureMess = autoMess @@ -61,12 +61,12 @@ autoMess (AutoMaster k bias delta) m = msum [fmap resize (fromMessage m), resize Shrink = AutoMaster k (max (-0.4) $ bias-delta) delta -- | Main layout function -autoLayout :: (LayoutClass l Window) => +autoLayout :: (Eq w, LayoutClass l w) => Int -> Float -> - W.Workspace WorkspaceId (l Window) Window + W.Workspace WorkspaceId (l w) w -> Rectangle - -> X ([(Window, Rectangle)], Maybe (l Window)) + -> X ([(w, Rectangle)], Maybe (l w)) autoLayout k bias wksp rect = do let stack = W.stack wksp let ws = W.integrate' stack |