aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Actions/Warp.hs
diff options
context:
space:
mode:
authorNorbert Zeh <nzeh@cs.dal.ca>2008-12-12 21:35:32 +0100
committerNorbert Zeh <nzeh@cs.dal.ca>2008-12-12 21:35:32 +0100
commit503a4f5977438a92ea2084685eaa02f2d66b9164 (patch)
treee22081ccf9a7057e95b684988dfc0e9b268932e3 /XMonad/Actions/Warp.hs
parent3dee7f3c12242f698b57c5c278b15869f6c4aef7 (diff)
downloadXMonadContrib-503a4f5977438a92ea2084685eaa02f2d66b9164.tar.gz
XMonadContrib-503a4f5977438a92ea2084685eaa02f2d66b9164.tar.xz
XMonadContrib-503a4f5977438a92ea2084685eaa02f2d66b9164.zip
fix focus issue for XMonad.Actions.Warp.banishScreen
This patch ensures that the focus (or in fact the whose windowset) does not change as a result of a banishScreen. The way this is implemented will become problematic if xmonad ever goes multithreaded. darcs-hash:20081212203532-18a2b-34ebdf2ce7f1bb64f70e42a856342654c4fe3690.gz
Diffstat (limited to '')
-rw-r--r--XMonad/Actions/Warp.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/XMonad/Actions/Warp.hs b/XMonad/Actions/Warp.hs
index 7536a1c..863d0f6 100644
--- a/XMonad/Actions/Warp.hs
+++ b/XMonad/Actions/Warp.hs
@@ -77,8 +77,10 @@ banishScreen direction = case direction of
UpperRight -> warpToCurrentScreen 1 0
where
warpToCurrentScreen h v =
- do (StackSet { current = x }) <- gets windowset
- warpToScreen (W.screen x) h v
+ do ws <- gets windowset
+ warpToScreen (W.screen $ current ws) h v
+ windows (const ws)
+
fraction :: (Integral a, Integral b) => Rational -> a -> b
fraction f x = floor (f * fromIntegral x)