aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoachim Breitner <mail@joachim-breitner.de>2008-06-10 21:59:16 +0200
committerJoachim Breitner <mail@joachim-breitner.de>2008-06-10 21:59:16 +0200
commitfcce5245205ccbb828f57425b37aeaf6c4d3980e (patch)
treead6c3d05970380af1bc22f577c16aac54127657b
parent489eb44274ce281158d1d3d77260db41bb4204d0 (diff)
downloadXMonadContrib-fcce5245205ccbb828f57425b37aeaf6c4d3980e.tar.gz
XMonadContrib-fcce5245205ccbb828f57425b37aeaf6c4d3980e.tar.xz
XMonadContrib-fcce5245205ccbb828f57425b37aeaf6c4d3980e.zip
Only move pointers over managed windows
darcs-hash:20080610195916-23c07-acb9d3a32366a2d83284a837fdac009e54335d5b.gz
-rw-r--r--XMonad/Actions/UpdatePointer.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/XMonad/Actions/UpdatePointer.hs b/XMonad/Actions/UpdatePointer.hs
index 6761506..9360fde 100644
--- a/XMonad/Actions/UpdatePointer.hs
+++ b/XMonad/Actions/UpdatePointer.hs
@@ -25,6 +25,7 @@ module XMonad.Actions.UpdatePointer
import XMonad
import Control.Monad
+import XMonad.StackSet (member)
-- $usage
-- You can use this module with the following in your @~\/.xmonad\/xmonad.hs@:
@@ -56,13 +57,15 @@ data PointerPosition = Nearest | Relative Rational Rational
-- focus with the mouse
updatePointer :: PointerPosition -> X ()
updatePointer p = withFocused $ \w -> do
+ ws <- gets windowset
dpy <- asks display
root <- asks theRoot
mouseIsMoving <- asks mouseFocused
wa <- io $ getWindowAttributes dpy w
- (_sameRoot,_,_,rootx,rooty,_,_,_) <- io $ queryPointer dpy root
+ (_sameRoot,_,currentWindow,rootx,rooty,_,_,_) <- io $ queryPointer dpy root
unless (pointWithinRegion rootx rooty (wa_x wa) (wa_y wa) (wa_width wa) (wa_height wa)
- || mouseIsMoving) $
+ || mouseIsMoving
+ || not (currentWindow `member` ws)) $
case p of
Nearest -> do
let x = moveWithin rootx (wa_x wa) ((wa_x wa) + (wa_width wa))