diff options
author | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-10-01 18:46:27 +0200 |
---|---|---|
committer | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-10-01 18:46:27 +0200 |
commit | 3930d2dff355be29c51932e7762b5cf85b4d6a55 (patch) | |
tree | af00ef4ba8c6f9fd4021f93747fd9929eaf32e1e | |
parent | 596be5ddf371dae9d5e07da35b3773cda5423eef (diff) | |
download | metatile-3930d2dff355be29c51932e7762b5cf85b4d6a55.tar metatile-3930d2dff355be29c51932e7762b5cf85b4d6a55.zip |
First cut at manageHook
darcs-hash:20071001164627-a5988-bf9560048dd0abaf2298a1eb5c0e1fc7e9654c16
-rw-r--r-- | Config.hs | 3 | ||||
-rw-r--r-- | Config.hs-boot | 1 | ||||
-rw-r--r-- | Operations.hs | 10 |
3 files changed, 9 insertions, 5 deletions
@@ -62,6 +62,9 @@ modMask = mod1Mask defaultGaps :: [(Int,Int,Int,Int)] defaultGaps = [(0,0,0,0)] -- 15 for default dzen +manageHook :: Window -> X (WindowSet -> WindowSet) +manageHook _ = return id + -- | -- numlock handling: -- diff --git a/Config.hs-boot b/Config.hs-boot index 8b82d53..906ee3b 100644 --- a/Config.hs-boot +++ b/Config.hs-boot @@ -7,3 +7,4 @@ logHook :: X () numlockMask :: KeyMask workspaces :: [WorkspaceId] possibleLayouts :: [SomeLayout Window] +manageHook :: Window -> X (WindowSet -> WindowSet) diff --git a/Operations.hs b/Operations.hs index ee58161..3e447be 100644 --- a/Operations.hs +++ b/Operations.hs @@ -20,7 +20,7 @@ module Operations where import XMonad import qualified StackSet as W -import {-# SOURCE #-} Config (borderWidth,logHook,numlockMask,possibleLayouts) +import {-# SOURCE #-} Config (borderWidth,logHook,manageHook,numlockMask,possibleLayouts) import Data.Maybe import Data.List (nub, (\\), find, partition) @@ -49,8 +49,6 @@ import Graphics.X11.Xlib.Extras -- manage :: Window -> X () manage w = whenX (fmap not $ isClient w) $ withDisplay $ \d -> do - setInitialProperties w - sh <- io $ getWMNormalHints d w let isFixedSize = sh_min_size sh /= Nothing && sh_min_size sh == sh_max_size sh @@ -62,10 +60,11 @@ manage w = whenX (fmap not $ isClient w) $ withDisplay $ \d -> do = W.RationalRect (0.5 - wid/2) (0.5 - h/2) wid h adjust r = r - let f ws | isFixedSize || isTransient = W.float w (adjust rr) . W.insertUp w . W.view i $ ws + f ws | isFixedSize || isTransient = W.float w (adjust rr) . W.insertUp w . W.view i $ ws | otherwise = W.insertUp w ws where i = fromMaybe (W.tag . W.workspace . W.current $ ws) $ W.lookupWorkspace sc ws - windows f + g <- manageHook w + windows (g . f) -- | unmanage. A window no longer exists, remove it from the window -- list, on whatever workspace it is. @@ -119,6 +118,7 @@ windows f = do let oldvisible = concatMap (W.integrate' . W.stack . W.workspace) $ W.current old : W.visible old ws = f old XConf { display = d , normalBorder = nbc, focusedBorder = fbc } <- ask + mapM_ setInitialProperties (W.allWindows ws \\ W.allWindows old) whenJust (W.peek old) $ \otherw -> io $ setWindowBorder d otherw nbc modify (\s -> s { windowset = ws }) |