From e73f1badf8987b922999ac5bf409f4d0bfac3f28 Mon Sep 17 00:00:00 2001 From: Spencer Janssen Date: Mon, 26 Mar 2007 14:47:25 +0200 Subject: 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.gz --- Operations.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Operations.hs') 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 () -- cgit v1.2.3