diff options
author | Nils Schweinsberg <mail@n-sch.de> | 2010-02-22 00:15:50 +0100 |
---|---|---|
committer | Nils Schweinsberg <mail@n-sch.de> | 2010-02-22 00:15:50 +0100 |
commit | 3e0aa1c6a78e821af38f08e8e1489f916161b1af (patch) | |
tree | 813b55dbfa12400abdaa3cad7e74dde0d673dc85 /XMonad | |
parent | 01419b795d5b66f80bb7a372c28b7254cf0ffeb1 (diff) | |
download | XMonadContrib-3e0aa1c6a78e821af38f08e8e1489f916161b1af.tar.gz XMonadContrib-3e0aa1c6a78e821af38f08e8e1489f916161b1af.tar.xz XMonadContrib-3e0aa1c6a78e821af38f08e8e1489f916161b1af.zip |
[patch] X.H.ScreenCorners: move the mouse cursor to avoid loops
Ignore-this: c8d2ece0f6e75aba1b091d5f9de371dc
darcs-hash:20100221231550-1f2e3-903c0adcd9fece225eb73730bbf85b688fedd987.gz
Diffstat (limited to 'XMonad')
-rw-r--r-- | XMonad/Hooks/ScreenCorners.hs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/XMonad/Hooks/ScreenCorners.hs b/XMonad/Hooks/ScreenCorners.hs index 7475811..751e950 100644 --- a/XMonad/Hooks/ScreenCorners.hs +++ b/XMonad/Hooks/ScreenCorners.hs @@ -44,16 +44,19 @@ inCorner corner xF dpy ix iy = do xMax = displayWidth dpy screen - 1 yMax = displayHeight dpy screen - 1 pos = case (ix,iy, corner) of - (0,0, SCUpperLeft) -> Just () - (x,0, SCUpperRight) | x == xMax -> Just () - (0,y, SCLowerLeft) | y == yMax -> Just () - (x,y, SCLowerRight) | x == xMax && y == yMax -> Just () + (0,0, SCUpperLeft) -> Just (50, 50) + (x,0, SCUpperRight) | x == xMax -> Just (x - 50, 50) + (0,y, SCLowerLeft) | y == yMax -> Just (50, y - 50) + (x,y, SCLowerRight) | x == xMax && y == yMax -> Just (x - 50, y - 50) _ -> Nothing case pos of - Just _ -> do + Just (x,y) -> do -- Ignore any MotionEvents defaultEventInput + -- move the mouse cursor so we avoid an unwanted loop + rootw <- asks theRoot + io $ warpPointer dpy none rootw 0 0 0 0 (fromIntegral x) (fromIntegral y) -- Run our X () xF -- Handle MotionEvents again |