summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Layouts.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/Layouts.hs b/Layouts.hs
index 2d9facf..30c70ea 100644
--- a/Layouts.hs
+++ b/Layouts.hs
@@ -71,6 +71,14 @@ instance (LayoutClass l a, LayoutClass r a) => LayoutClass (Choose l r) a where
mr <- handleMessage r (SomeMessage FirstLayout)
return . Just . SRight l $ fromMaybe r mr
+ handleMessage lr m | Just ReleaseResources <- fromMessage m =
+ liftM2 ((Just .) . cons)
+ (fmap (fromMaybe l) $ handleMessage l m)
+ (fmap (fromMaybe r) $ handleMessage r m)
+ where (cons, l, r) = case lr of
+ (SLeft r l) -> (flip SLeft, l, r)
+ (SRight l r) -> (SRight, l, r)
+
-- The default cases for left and right:
handleMessage (SLeft r l) m = fmap (fmap $ SLeft r) $ handleMessage l m
handleMessage (SRight l r) m = fmap (fmap $ SRight l) $ handleMessage r m