From 9dae24bfd8051c923f0ac3238d7efc20a68a9762 Mon Sep 17 00:00:00 2001 From: Joachim Breitner Date: Tue, 10 Jun 2008 19:59:16 +0000 Subject: [PATCH] Only move pointers over managed windows --- XMonad/Actions/UpdatePointer.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/XMonad/Actions/UpdatePointer.hs b/XMonad/Actions/UpdatePointer.hs index 6761506b..9360fde2 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))