aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Creighton <jcreigh@gmail.com>2007-03-30 05:54:54 +0200
committerJason Creighton <jcreigh@gmail.com>2007-03-30 05:54:54 +0200
commitfd12ac51ea6250e79fde59401f9515b705cd5b24 (patch)
tree447d2e03f273e30a8ee3eb3eb19f984907070873
parentacdff238a5d09ff0a382cb6cab188635a765f6f8 (diff)
downloadxmonad-fd12ac51ea6250e79fde59401f9515b705cd5b24.tar.gz
xmonad-fd12ac51ea6250e79fde59401f9515b705cd5b24.tar.xz
xmonad-fd12ac51ea6250e79fde59401f9515b705cd5b24.zip
refactored "focus changed" code into "refocus"
darcs-hash:20070330035454-b9aa7-54e1b09c030cec67d02902847258a2a14dcdc409.gz
-rw-r--r--Main.hs1
-rw-r--r--Operations.hs13
2 files changed, 11 insertions, 3 deletions
diff --git a/Main.hs b/Main.hs
index bfa6247..0524fc7 100644
--- a/Main.hs
+++ b/Main.hs
@@ -127,6 +127,7 @@ safeFocus w = do ws <- gets workspace
then setFocus w
else do b <- isRoot w
when b setTopFocus
+ refocus
handle :: Event -> X ()
diff --git a/Operations.hs b/Operations.hs
index ef630db..bf792da 100644
--- a/Operations.hs
+++ b/Operations.hs
@@ -41,9 +41,6 @@ refresh = do
fl = M.findWithDefault dfltfl n fls
l = layoutType fl
ratio = tileFraction fl
- mapM_ (setButtonGrab True) (W.index n ws)
- when (n == W.current ws) $
- maybe (return ()) (setButtonGrab False) (W.peekStack n ws)
case l of
Full -> whenJust (W.peekStack n ws) $ \w -> do
move w sx sy sw sh
@@ -59,6 +56,16 @@ refresh = do
zipWithM_ (\i a -> move a (sx + lw) (sy + i * rh) rw (fromIntegral rh)) [0..] s
whenJust (W.peek ws) (io . raiseWindow d) -- this is always Just
whenJust (W.peek ws) setFocus
+ refocus
+
+refocus :: X ()
+refocus = do
+ ws2sc <- gets wsOnScreen
+ ws <- gets workspace
+ flip mapM_ (M.keys ws2sc) $ \n -> do
+ mapM_ (setButtonGrab True) (W.index n ws)
+ when (n == W.current ws) $
+ maybe (return ()) (setButtonGrab False) (W.peekStack n ws)
-- | switchLayout. Switch to another layout scheme. Switches the current workspace.
switchLayout :: X ()