diff options
author | Andrea Rossato <andrea.rossato@unibz.it> | 2008-02-18 14:13:20 +0100 |
---|---|---|
committer | Andrea Rossato <andrea.rossato@unibz.it> | 2008-02-18 14:13:20 +0100 |
commit | 7c7884a5d86cffaf306fde89d9d4d3a85d160d5c (patch) | |
tree | 42c84c73aadcec349f9aab86e1c0dd033c846d91 /XMonad/Layout/Decoration.hs | |
parent | 8c595555ce9d1f1d2bfce4bf0ff441d75b79b1c0 (diff) | |
download | XMonadContrib-7c7884a5d86cffaf306fde89d9d4d3a85d160d5c.tar.gz XMonadContrib-7c7884a5d86cffaf306fde89d9d4d3a85d160d5c.tar.xz XMonadContrib-7c7884a5d86cffaf306fde89d9d4d3a85d160d5c.zip |
add Eq superclass to DecorationStyle and change styles in order not to decorate non managed windows
darcs-hash:20080218131320-32816-44ecfbd0dca9eb353a569898deefebef9f7088ed.gz
Diffstat (limited to 'XMonad/Layout/Decoration.hs')
-rw-r--r-- | XMonad/Layout/Decoration.hs | 9 |
1 files changed, 6 insertions, 3 deletions
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 |