More porting

This commit is contained in:
Spencer Janssen 2007-11-01 07:35:06 +00:00
parent e16479570a
commit 332ecc3e11
2 changed files with 7 additions and 7 deletions

View File

@ -56,10 +56,10 @@ instance LayoutModifier WithBorder Window where
modifierDescription (WithBorder 0 _) = "NoBorders" modifierDescription (WithBorder 0 _) = "NoBorders"
modifierDescription (WithBorder n _) = "Borders " ++ show n modifierDescription (WithBorder n _) = "Borders " ++ show n
unhook (WithBorder _ s) = asks borderWidth >>= setBorders s unhook (WithBorder _ s) = asks (borderWidth . config) >>= setBorders s
redoLayout (WithBorder n s) _ _ wrs = do redoLayout (WithBorder n s) _ _ wrs = do
asks borderWidth >>= setBorders (s \\ ws) asks (borderWidth . config) >>= setBorders (s \\ ws)
setBorders ws n setBorders ws n
return (wrs, Just $ WithBorder n ws) return (wrs, Just $ WithBorder n ws)
where where
@ -79,18 +79,18 @@ data SmartBorder a = SmartBorder [a] deriving (Read, Show)
instance LayoutModifier SmartBorder Window where instance LayoutModifier SmartBorder Window where
modifierDescription _ = "SmartBorder" modifierDescription _ = "SmartBorder"
unhook (SmartBorder s) = asks borderWidth >>= setBorders s unhook (SmartBorder s) = asks (borderWidth . config) >>= setBorders s
redoLayout (SmartBorder s) _ _ wrs = do redoLayout (SmartBorder s) _ _ wrs = do
ss <- gets (W.screens . windowset) ss <- gets (W.screens . windowset)
if singleton ws && singleton ss if singleton ws && singleton ss
then do then do
asks borderWidth >>= setBorders (s \\ ws) asks (borderWidth . config) >>= setBorders (s \\ ws)
setBorders ws 0 setBorders ws 0
return (wrs, Just $ SmartBorder ws) return (wrs, Just $ SmartBorder ws)
else do else do
asks borderWidth >>= setBorders s asks (borderWidth . config) >>= setBorders s
return (wrs, Just $ SmartBorder []) return (wrs, Just $ SmartBorder [])
where where
ws = map fst wrs ws = map fst wrs

4
Run.hs
View File

@ -108,8 +108,8 @@ unsafeSpawn = spawn
-- | Run a given program in the preferred terminal emulator. This uses safeSpawn. -- | Run a given program in the preferred terminal emulator. This uses safeSpawn.
safeRunInTerm :: String -> X () safeRunInTerm :: String -> X ()
safeRunInTerm command = asks terminal >>= \t -> safeSpawn t ("-e " ++ command) safeRunInTerm command = asks (terminal . config) >>= \t -> safeSpawn t ("-e " ++ command)
unsafeRunInTerm, runInTerm :: String -> X () unsafeRunInTerm, runInTerm :: String -> X ()
unsafeRunInTerm command = asks terminal >>= \t -> unsafeSpawn $ t ++ " -e " ++ command unsafeRunInTerm command = asks (terminal . config) >>= \t -> unsafeSpawn $ t ++ " -e " ++ command
runInTerm = unsafeRunInTerm runInTerm = unsafeRunInTerm