aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Actions
diff options
context:
space:
mode:
authorKlaus Weidner <kweidner@pobox.com>2008-04-17 04:22:34 +0200
committerKlaus Weidner <kweidner@pobox.com>2008-04-17 04:22:34 +0200
commit2f42df31b9d8df9cf0854a9604a8d80f3b8f9880 (patch)
tree30308b2b63c7c175ae582b163ccdae1979eb03b9 /XMonad/Actions
parent2190f4028667afbf45713c24c6d3694fbe5fafb1 (diff)
downloadXMonadContrib-2f42df31b9d8df9cf0854a9604a8d80f3b8f9880.tar.gz
XMonadContrib-2f42df31b9d8df9cf0854a9604a8d80f3b8f9880.tar.xz
XMonadContrib-2f42df31b9d8df9cf0854a9604a8d80f3b8f9880.zip
Don't move the pointer if the user is moving the mouse
This patch depends on the following xmonad core patch: Remember if focus changes were caused by mouse actions or by key commands If the user was moving the mouse, it's not appropriate to move the pointer around in resonse to focus changes. Do that only in response to keyboard commands. darcs-hash:20080417022234-e41d7-ee4ac41e65b28124cc3926693987d377d725dc34.gz
Diffstat (limited to 'XMonad/Actions')
-rw-r--r--XMonad/Actions/UpdatePointer.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/XMonad/Actions/UpdatePointer.hs b/XMonad/Actions/UpdatePointer.hs
index 61df4c8..b2751bf 100644
--- a/XMonad/Actions/UpdatePointer.hs
+++ b/XMonad/Actions/UpdatePointer.hs
@@ -52,15 +52,17 @@ import Control.Monad
data PointerPosition = Nearest | Relative Rational Rational
-- | Update the pointer's location to the currently focused
--- window unless it's already there
+-- window unless it's already there, or unless the user was changing
+-- focus with the mouse
updatePointer :: PointerPosition -> X ()
updatePointer p = withFocused $ \w -> do
dpy <- asks display
root <- asks theRoot
+ mouseIsMoving <- asks mouseFocused
wa <- io $ getWindowAttributes dpy w
(_sameRoot,_,w',rootx,rooty,_,_,_) <- io $ queryPointer dpy root
-- Can sameRoot ever be false in this case? I'm going to assume not
- unless (w == w') $
+ unless (w == w' || mouseIsMoving) $
case p of
Nearest -> do
let x = moveWithin rootx (wa_x wa) ((wa_x wa) + (wa_width wa))