I'm trying to make xmonad focus the window underneath the pointer when the mouse is moved, regardless of which window is focused. This was addressed in this question; however, the provided solution suggests using XMonad.Actions.UpdateFocus which doesn't work. I decided I would just rewrite the functionality of UpdateFocus, but I'm not sure how to get a mouse movement/hover hook to do that.
I did some experimentation on my own, and I discovered that MotionEvents aren't being passed to the eventHook if the mouse is over a window that is interested in its own mouse events. Examples of such windows include gnome-terminal and nautilus. There is a mailing list thread discussing this problem. Here was the code I used for the experimentation.
focusOnMouseMove :: Event -> X All
focusOnMouseMove (MotionEvent { ev_x = x, ev_y = y, ev_window = root }) = do
return (debugPrint ((show x) ++ " " ++ (show y)) (All True))
-- later in my config
rootMask = rootMask defaultConfig .|. pointerMotionMask,
clientMask = clientMask defaultConfig .|. pointerMotionMask,
startupHook = adjustEventInput,
handleEventHook = myEventHook,