aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad
diff options
context:
space:
mode:
authorNorbert Zeh <nzeh@cs.dal.ca>2008-12-12 20:26:21 +0100
committerNorbert Zeh <nzeh@cs.dal.ca>2008-12-12 20:26:21 +0100
commit3dee7f3c12242f698b57c5c278b15869f6c4aef7 (patch)
treeeb19748599b6eaa1fc73fa7fbf3eb37e1c065c8f /XMonad
parent61211cbf62d50bf3f953a028d368518fb9092b67 (diff)
downloadXMonadContrib-3dee7f3c12242f698b57c5c278b15869f6c4aef7.tar.gz
XMonadContrib-3dee7f3c12242f698b57c5c278b15869f6c4aef7.tar.xz
XMonadContrib-3dee7f3c12242f698b57c5c278b15869f6c4aef7.zip
addition of XMonad.Actions.Warp.banishScreen
This works on top of warpToScreen and, thus, suffers from the same issue: focus change. darcs-hash:20081212192621-18a2b-bdba455f6fe9c8103ae8b932b8577b6614de3cb5.gz
Diffstat (limited to '')
-rw-r--r--XMonad/Actions/Warp.hs16
1 files changed, 15 insertions, 1 deletions
diff --git a/XMonad/Actions/Warp.hs b/XMonad/Actions/Warp.hs
index bc30fc6..7536a1c 100644
--- a/XMonad/Actions/Warp.hs
+++ b/XMonad/Actions/Warp.hs
@@ -16,6 +16,7 @@ module XMonad.Actions.Warp (
-- * Usage
-- $usage
banish,
+ banishScreen,
Corner(..),
warpToScreen,
warpToWindow
@@ -64,7 +65,20 @@ banish direction = case direction of
LowerRight -> warpToWindow 1 1
LowerLeft -> warpToWindow 0 1
UpperLeft -> warpToWindow 0 0
- UpperRight -> warpToWindow 1 0
+ UpperRight -> warpToWindow 1 0
+
+{- | Same as 'banish' but moves the mouse to the corner of the
+ currently focused screen -}
+banishScreen :: Corner -> X ()
+banishScreen direction = case direction of
+ LowerRight -> warpToCurrentScreen 1 1
+ LowerLeft -> warpToCurrentScreen 0 1
+ UpperLeft -> warpToCurrentScreen 0 0
+ UpperRight -> warpToCurrentScreen 1 0
+ where
+ warpToCurrentScreen h v =
+ do (StackSet { current = x }) <- gets windowset
+ warpToScreen (W.screen x) h v
fraction :: (Integral a, Integral b) => Rational -> a -> b
fraction f x = floor (f * fromIntegral x)