diff options
author | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-03-26 14:47:25 +0200 |
---|---|---|
committer | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-03-26 14:47:25 +0200 |
commit | 1fb19cbe7d6db20c96a784dea075591260f5a949 (patch) | |
tree | 77843274649fa7e85928cc288ce97cf6b25ff6c4 | |
parent | 40ad77db0daa3a523e75596fcefcfac9a84d2d03 (diff) | |
download | metatile-1fb19cbe7d6db20c96a784dea075591260f5a949.tar metatile-1fb19cbe7d6db20c96a784dea075591260f5a949.zip |
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.
darcs-hash:20070326124725-a5988-825770ffc28620d16b7aba0541e3abff29b46680
-rw-r--r-- | Operations.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Operations.hs b/Operations.hs index 73d609c..70f6530 100644 --- a/Operations.hs +++ b/Operations.hs @@ -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 () |