From 2f42df31b9d8df9cf0854a9604a8d80f3b8f9880 Mon Sep 17 00:00:00 2001 From: Klaus Weidner Date: Thu, 17 Apr 2008 04:22:34 +0200 Subject: 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 --- XMonad/Actions/UpdatePointer.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'XMonad/Actions') 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)) -- cgit v1.2.3