summaryrefslogtreecommitdiffstats
path: root/Operations.hs
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
commit3a5df909b093de0734a67a7da35a09e037e6fd70 (patch)
tree78e8c0cd580bfbe8984211ec81b2875637e77986 /Operations.hs
parenta83a3231648b4dd8db78447ddc0008d0170cd550 (diff)
downloadmetatile-3a5df909b093de0734a67a7da35a09e037e6fd70.tar
metatile-3a5df909b093de0734a67a7da35a09e037e6fd70.zip
refactor only
darcs-hash:20070527154353-9c5c1-6ef13fd2212f3a18a3050c47d71eb250ec4ec683
Diffstat (limited to 'Operations.hs')
-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.