From d2d1294856f855ed492ad3cdba9013333689cb8a Mon Sep 17 00:00:00 2001 From: Ilya Portnov Date: Sat, 14 May 2011 15:25:49 +0200 Subject: 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 --- XMonad/Layout/AutoMaster.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'XMonad/Layout/AutoMaster.hs') 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 -- cgit v1.2.3