mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-14 03:35:54 -07:00
addition of XMonad.Actions.Warp.banishScreen
This works on top of warpToScreen and, thus, suffers from the same issue: focus change.
This commit is contained in:
@@ -16,6 +16,7 @@ module XMonad.Actions.Warp (
|
|||||||
-- * Usage
|
-- * Usage
|
||||||
-- $usage
|
-- $usage
|
||||||
banish,
|
banish,
|
||||||
|
banishScreen,
|
||||||
Corner(..),
|
Corner(..),
|
||||||
warpToScreen,
|
warpToScreen,
|
||||||
warpToWindow
|
warpToWindow
|
||||||
@@ -64,7 +65,20 @@ banish direction = case direction of
|
|||||||
LowerRight -> warpToWindow 1 1
|
LowerRight -> warpToWindow 1 1
|
||||||
LowerLeft -> warpToWindow 0 1
|
LowerLeft -> warpToWindow 0 1
|
||||||
UpperLeft -> warpToWindow 0 0
|
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 :: (Integral a, Integral b) => Rational -> a -> b
|
||||||
fraction f x = floor (f * fromIntegral x)
|
fraction f x = floor (f * fromIntegral x)
|
||||||
|
Reference in New Issue
Block a user