aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDon Stewart <dons@cse.unsw.edu.au>2007-05-27 17:43:53 +0200
committerDon Stewart <dons@cse.unsw.edu.au>2007-05-27 17:43:53 +0200
commitd16455deaf8da1e688c18ac66bddf5dd93905c49 (patch)
tree78e8c0cd580bfbe8984211ec81b2875637e77986
parentf18a4a64da8e5e5e295cf676e5a56e6f1f1003b3 (diff)
downloadxmonad-d16455deaf8da1e688c18ac66bddf5dd93905c49.tar.gz
xmonad-d16455deaf8da1e688c18ac66bddf5dd93905c49.tar.xz
xmonad-d16455deaf8da1e688c18ac66bddf5dd93905c49.zip
refactor only
darcs-hash:20070527154353-9c5c1-6ef13fd2212f3a18a3050c47d71eb250ec4ec683.gz
-rw-r--r--Operations.hs15
1 files changed, 5 insertions, 10 deletions
diff --git a/Operations.hs b/Operations.hs
index e1ee0cd..8d99569 100644
--- a/Operations.hs
+++ b/Operations.hs
@@ -69,9 +69,7 @@ view = windows . W.view
-- | Modify the size of the status gap at the top of the screen
modifyGap :: (Int -> Int) -> X ()
-modifyGap f = do modify $ \s -> s { statusGap = max 0 (f (statusGap s)) }
- refresh
-
+modifyGap f = modify (\s -> s { statusGap = max 0 (f (statusGap s)) }) >> refresh
-- | Kill the currently focused client. If we do kill it, we'll get a
-- delete notify back from X.
@@ -141,9 +139,8 @@ refresh = do
-- now tile the windows on this workspace, and set gap maybe on current
rs <- doLayout l (if w == W.current ws
- then Rectangle sx (sy + fromIntegral gap)
- sw (sh - fromIntegral gap)
- else r) (W.index this)
+ then Rectangle sx (sy + fromIntegral gap) sw (sh - fromIntegral gap)
+ else r) (W.index this)
mapM_ (\(win,rect) -> io (tileWindow d win rect)) rs
-- and raise the focused window if there is one.
@@ -214,10 +211,8 @@ setTopFocus = withWorkspace $ maybe (setFocusX =<< asks theRoot) setFocusX . W.p
-- the mouse to a new screen).
focus :: Window -> X ()
focus w = withWorkspace $ \s -> do
- if W.member w s then do modify $ \st -> st { windowset = W.focusWindow w s } -- avoid 'refresh'
- refresh -- and set gap -- was: setFocusX w
- else whenX (isRoot w) $ setFocusX w
- -- we could refresh here, moving gap too.
+ if W.member w s then modify (\st -> st { windowset = W.focusWindow w s }) >> refresh
+ else whenX (isRoot w) $ setFocusX w -- we could refresh here, moving gap too.
-- XXX a focus change could be caused by switching workspaces in xinerama.
-- if so, and the gap is in use, the gap should probably follow the
-- cursor to the new screen.