diff options
author | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-10-03 18:24:04 +0200 |
---|---|---|
committer | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-10-03 18:24:04 +0200 |
commit | 1888686182ff298b4decec0d660e5e8522feed54 (patch) | |
tree | 8ed40d175841624d0749952920a690066bdea0b2 | |
parent | 4433b1119ca12a43c7c023f734d368f400a3ec4c (diff) | |
download | metatile-1888686182ff298b4decec0d660e5e8522feed54.tar metatile-1888686182ff298b4decec0d660e5e8522feed54.zip |
manageHook: use the curry style, better documentation
darcs-hash:20071003162404-a5988-0e2b858c29ae9ba45ffa28137b61f5ac671bf005
-rw-r--r-- | Config.hs | 15 | ||||
-rw-r--r-- | Config.hs-boot | 2 | ||||
-rw-r--r-- | Operations.hs | 2 |
3 files changed, 12 insertions, 7 deletions
@@ -62,20 +62,25 @@ modMask = mod1Mask defaultGaps :: [(Int,Int,Int,Int)] defaultGaps = [(0,0,0,0)] -- 15 for default dzen --- | manageHook. Execute arbitrary actions and WindowSet manipulations when +-- | +-- Execute arbitrary actions and WindowSet manipulations when -- managing a new window. -manageHook :: Window -> (String, String, String) -> X (WindowSet -> WindowSet) +manageHook :: Window -- ^ the new window to manage + -> String -- ^ window title + -> String -- ^ window resource name + -> String -- ^ window resource class + -> X (WindowSet -> WindowSet) -- Float various windows: -manageHook w (_, _, c) | c `elem` floats = fmap (W.float w . snd) (floatLocation w) +manageHook w _ _ c | c `elem` floats = fmap (W.float w . snd) (floatLocation w) where floats = ["MPlayer", "Gimp"] -- Don't manage various panels and desktop windows: -manageHook w (_, c, _) | c `elem` ignore = reveal w >> return (W.delete w) +manageHook w _ n _ | n `elem` ignore = reveal w >> return (W.delete w) where ignore = ["gnome-panel", "desktop_window", "kicker", "kdesktop"] -- The default rule, do not edit this line. -manageHook _ _ = return id +manageHook _ _ _ _ = return id -- | -- numlock handling: diff --git a/Config.hs-boot b/Config.hs-boot index d010c83..b6151c8 100644 --- a/Config.hs-boot +++ b/Config.hs-boot @@ -7,4 +7,4 @@ logHook :: X () numlockMask :: KeyMask workspaces :: [WorkspaceId] possibleLayouts :: [Layout Window] -manageHook :: Window -> (String, String, String) -> X (WindowSet -> WindowSet) +manageHook :: Window -> String -> String -> String -> X (WindowSet -> WindowSet) diff --git a/Operations.hs b/Operations.hs index 8c2623f..62e007c 100644 --- a/Operations.hs +++ b/Operations.hs @@ -66,7 +66,7 @@ manage w = whenX (fmap not $ isClient w) $ withDisplay $ \d -> do n <- fmap (fromMaybe "") $ io $ fetchName d w (ClassHint rn rc) <- io $ getClassHint d w - g <- manageHook w (n, rn, rc) + g <- manageHook w n rn rc windows (g . f) -- | unmanage. A window no longer exists, remove it from the window |