aboutsummaryrefslogtreecommitdiffstats
path: root/LayoutModifier.hs
diff options
context:
space:
mode:
authorSpencer Janssen <sjanssen@cse.unl.edu>2007-09-28 19:45:10 +0200
committerSpencer Janssen <sjanssen@cse.unl.edu>2007-09-28 19:45:10 +0200
commitef1d84e3babdebaa1c50d3eedbb779288ae58148 (patch)
tree2e27f1afcb1413e017b048eb62b2674c547f9214 /LayoutModifier.hs
parent7f0c492f12e298a69df4af87d45d75dd6683ca6e (diff)
downloadXMonadContrib-ef1d84e3babdebaa1c50d3eedbb779288ae58148.tar.gz
XMonadContrib-ef1d84e3babdebaa1c50d3eedbb779288ae58148.tar.xz
XMonadContrib-ef1d84e3babdebaa1c50d3eedbb779288ae58148.zip
LayoutModifier: call unhook after releaseResources
darcs-hash:20070928174510-a5988-a7a20cfad92710b8b746fc182d83f109494de015.gz
Diffstat (limited to 'LayoutModifier.hs')
-rw-r--r--LayoutModifier.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/LayoutModifier.hs b/LayoutModifier.hs
index 8785c5f..1320fac 100644
--- a/LayoutModifier.hs
+++ b/LayoutModifier.hs
@@ -20,15 +20,17 @@ module XMonadContrib.LayoutModifier (
import Graphics.X11.Xlib ( Rectangle )
import XMonad
import StackSet ( Stack )
-import Operations ( LayoutMessages(Hide) )
+import Operations ( LayoutMessages(Hide, ReleaseResources) )
-- $usage
-- Use LayoutHelpers to help write easy Layouts.
class (Show (m a), Read (m a)) => LayoutModifier m a where
modifyModify :: m a -> SomeMessage -> X (Maybe (m a))
- modifyModify m mess | Just Hide <- fromMessage mess = do unhook m; return Nothing
+ modifyModify m mess | Just Hide <- fromMessage mess = doUnhook
+ | Just ReleaseResources <- fromMessage mess = doUnhook
| otherwise = return Nothing
+ where doUnhook = do unhook m; return Nothing
redoLayout :: m a -> Rectangle -> Stack a -> [(a, Rectangle)]
-> X ([(a, Rectangle)], Maybe (m a))
redoLayout m _ _ wrs = do hook m; return (wrs, Nothing)