Focus follows mouse.

This change makes the window under the mouse pointer the focused window.  This
isn't quite what we want, but it is a step in the right direction.  The next
step is to somehow inhibit the CrossingEvents generated during workspace and
layout switches.
This commit is contained in:
Spencer Janssen
2007-03-26 12:47:25 +00:00
parent 3288347e1e
commit 5bc238964d

View File

@@ -117,7 +117,11 @@ withServerX f = withDisplay $ \dpy -> do
-- | Explicitly set the keyboard focus to the given window
setFocus :: Window -> X ()
setFocus w = withDisplay $ \d -> io $ setInputFocus d w revertToPointerRoot 0
setFocus w = do
withDisplay $ \d -> io $ setInputFocus d w revertToPointerRoot 0
-- This does not use 'windows' intentionally. 'windows' calls refresh,
-- which means infinite loops.
modify (\s -> s { workspace = W.raiseFocus w (workspace s) })
-- | Set the focus to the window on top of the stack, or root
setTopFocus :: X ()