From 3e0aa1c6a78e821af38f08e8e1489f916161b1af Mon Sep 17 00:00:00 2001 From: Nils Schweinsberg Date: Mon, 22 Feb 2010 00:15:50 +0100 Subject: [patch] X.H.ScreenCorners: move the mouse cursor to avoid loops Ignore-this: c8d2ece0f6e75aba1b091d5f9de371dc darcs-hash:20100221231550-1f2e3-903c0adcd9fece225eb73730bbf85b688fedd987.gz --- XMonad/Hooks/ScreenCorners.hs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'XMonad') 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 -- cgit v1.2.3