aboutsummaryrefslogtreecommitdiff
path: root/src/Rahm/Desktop/Layout/Hole.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Rahm/Desktop/Layout/Hole.hs')
-rw-r--r--src/Rahm/Desktop/Layout/Hole.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Rahm/Desktop/Layout/Hole.hs b/src/Rahm/Desktop/Layout/Hole.hs
index fe48340..42bac48 100644
--- a/src/Rahm/Desktop/Layout/Hole.hs
+++ b/src/Rahm/Desktop/Layout/Hole.hs
@@ -1,16 +1,17 @@
-{-# LANGUAGE UndecidableInstances, DeriveAnyClass #-}
+{-# LANGUAGE DeriveAnyClass #-}
+{-# LANGUAGE UndecidableInstances #-}
-- Delegates to a lower layout, but leaves a hole where the next window will go.
module Rahm.Desktop.Layout.Hole (hole, toggleHole) where
-import XMonad
import Data.Maybe (mapMaybe)
-
import qualified Rahm.Desktop.StackSet as W
+import XMonad
data Hole (l :: * -> *) (a :: *) = Hole Bool (l a)
deriving instance Show (l a) => Show (Hole l a)
+
deriving instance Read (l a) => Read (Hole l a)
hole :: l a -> Hole l a
@@ -26,7 +27,7 @@ data ManageHole where
instance (LayoutClass l a, Eq a, Num a) => LayoutClass (Hole l) a where
runLayout (W.Workspace t (Hole enabled l) a) rect = do
(rects, maybeNewLayout) <- runLayout (app (-1) $ W.Workspace t l a) rect
- return (filter ((/=(-1)) . fst) rects, fmap (Hole enabled) maybeNewLayout)
+ return (filter ((/= (-1)) . fst) rects, fmap (Hole enabled) maybeNewLayout)
where
app x w | not enabled = w
app x (W.Workspace t l s) =