aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Operations.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/Operations.hs b/Operations.hs
index 5441476..ff6c19c 100644
--- a/Operations.hs
+++ b/Operations.hs
@@ -291,7 +291,7 @@ setTopFocus = withWindowSet $ maybe (setFocusX =<< asks theRoot) setFocusX . W.p
-- the mouse to a new screen).
focus :: Window -> X ()
focus w = withWindowSet $ \s -> do
- if W.member w s then windows (W.focusWindow w)
+ if W.member w s then when (W.peek s /= Just w) $ windows (W.focusWindow w)
else whenX (isRoot w) $ setFocusX w
-- | Call X to set the keyboard focus details.