mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 11:30:22 -07:00
UpdatePointer - Don't warp while dragging with mouse
This commit is contained in:
parent
72e2c5d0b4
commit
aa435aa5c8
@ -26,6 +26,7 @@ module XMonad.Actions.UpdatePointer
|
|||||||
import XMonad
|
import XMonad
|
||||||
import Control.Monad
|
import Control.Monad
|
||||||
import XMonad.StackSet (member, peek, screenDetail, current)
|
import XMonad.StackSet (member, peek, screenDetail, current)
|
||||||
|
import Data.Maybe
|
||||||
|
|
||||||
-- $usage
|
-- $usage
|
||||||
-- You can use this module with the following in your @~\/.xmonad\/xmonad.hs@:
|
-- You can use this module with the following in your @~\/.xmonad\/xmonad.hs@:
|
||||||
@ -66,8 +67,10 @@ updatePointer p = do
|
|||||||
root <- asks theRoot
|
root <- asks theRoot
|
||||||
mouseIsMoving <- asks mouseFocused
|
mouseIsMoving <- asks mouseFocused
|
||||||
(_sameRoot,_,currentWindow,rootx,rooty,_,_,_) <- io $ queryPointer dpy root
|
(_sameRoot,_,currentWindow,rootx,rooty,_,_,_) <- io $ queryPointer dpy root
|
||||||
|
drag <- gets dragging
|
||||||
unless (pointWithin (fi rootx) (fi rooty) rect
|
unless (pointWithin (fi rootx) (fi rooty) rect
|
||||||
|| mouseIsMoving
|
|| mouseIsMoving
|
||||||
|
|| isJust drag
|
||||||
|| not (currentWindow `member` ws || currentWindow == none)) $
|
|| not (currentWindow `member` ws || currentWindow == none)) $
|
||||||
case p of
|
case p of
|
||||||
Nearest -> do
|
Nearest -> do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user