From 3dee7f3c12242f698b57c5c278b15869f6c4aef7 Mon Sep 17 00:00:00 2001 From: Norbert Zeh Date: Fri, 12 Dec 2008 20:26:21 +0100 Subject: 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 --- XMonad/Actions/Warp.hs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'XMonad') 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) -- cgit v1.2.3