summaryrefslogtreecommitdiffstats
path: root/Operations.hs
diff options
context:
space:
mode:
authorSpencer Janssen <sjanssen@cse.unl.edu>2007-03-26 14:47:25 +0200
committerSpencer Janssen <sjanssen@cse.unl.edu>2007-03-26 14:47:25 +0200
commit1fb19cbe7d6db20c96a784dea075591260f5a949 (patch)
tree77843274649fa7e85928cc288ce97cf6b25ff6c4 /Operations.hs
parent40ad77db0daa3a523e75596fcefcfac9a84d2d03 (diff)
downloadmetatile-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
Diffstat (limited to 'Operations.hs')
-rw-r--r--Operations.hs6
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 ()