From 7c7884a5d86cffaf306fde89d9d4d3a85d160d5c Mon Sep 17 00:00:00 2001 From: Andrea Rossato Date: Mon, 18 Feb 2008 14:13:20 +0100 Subject: add Eq superclass to DecorationStyle and change styles in order not to decorate non managed windows darcs-hash:20080218131320-32816-44ecfbd0dca9eb353a569898deefebef9f7088ed.gz --- XMonad/Layout/Decoration.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'XMonad/Layout/Decoration.hs') diff --git a/XMonad/Layout/Decoration.hs b/XMonad/Layout/Decoration.hs index e18a6d1..1e6bf0e 100644 --- a/XMonad/Layout/Decoration.hs +++ b/XMonad/Layout/Decoration.hs @@ -98,7 +98,7 @@ data Decoration ds s a = Decoration (Invisible Maybe DecorationState) s Theme (ds a) deriving (Show, Read) -class (Read (ds a), Show (ds a)) => DecorationStyle ds a where +class (Read (ds a), Show (ds a), Eq a) => DecorationStyle ds a where describeDeco :: ds a -> String describeDeco ds = show ds @@ -120,14 +120,17 @@ class (Read (ds a), Show (ds a)) => DecorationStyle ds a where pureDecoration :: ds a -> Dimension -> Dimension -> Rectangle -> W.Stack a -> [(a,Rectangle)] -> (a,Rectangle) -> Maybe Rectangle - pureDecoration _ _ h _ _ _ (_,Rectangle x y w _) = Just $ Rectangle x y w h + pureDecoration _ _ ht _ s _ (w,Rectangle x y wh _) = if isInStack s w + then Just $ Rectangle x y wh ht + else Nothing + decorate :: ds a -> Dimension -> Dimension -> Rectangle -> W.Stack a -> [(a,Rectangle)] -> (a,Rectangle) -> X (Maybe Rectangle) decorate ds w h r s ars ar = return $ pureDecoration ds w h r s ars ar data DefaultDecoration a = DefaultDecoration deriving ( Read, Show ) -instance DecorationStyle DefaultDecoration a +instance Eq a => DecorationStyle DefaultDecoration a instance (DecorationStyle ds Window, Shrinker s) => LayoutModifier (Decoration ds s) Window where redoLayout (Decoration st sh t ds) sc stack wrs -- cgit v1.2.3