aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Operations.hs
diff options
context:
space:
mode:
authorAdam Vogt <vogt.adam@gmail.com>2012-01-03 02:39:16 +0100
committerAdam Vogt <vogt.adam@gmail.com>2012-01-03 02:39:16 +0100
commit6fd5a380b46edd755118bfe385a99609c2b7c142 (patch)
tree8c88b56d941721fc63520c88caf6e617403b5735 /XMonad/Operations.hs
parent415f11d534bdcb3d380bb3148a17d691e542ba05 (diff)
downloadxmonad-6fd5a380b46edd755118bfe385a99609c2b7c142.tar.gz
xmonad-6fd5a380b46edd755118bfe385a99609c2b7c142.tar.xz
xmonad-6fd5a380b46edd755118bfe385a99609c2b7c142.zip
Add configuration option clickToFocus (issue 225)
Ignore-this: 78961f6256e1a1ee25c085e9056af758 To summarize this allows clicks which change the focus to also be passed on to that window. darcs-hash:20120103013916-1499c-1c29f13f0565f4812cf5787caefb6142882f25b5.gz
Diffstat (limited to '')
-rw-r--r--XMonad/Operations.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/XMonad/Operations.hs b/XMonad/Operations.hs
index f2beea4..6bca311 100644
--- a/XMonad/Operations.hs
+++ b/XMonad/Operations.hs
@@ -283,11 +283,14 @@ rescreen = do
-- | setButtonGrab. Tell whether or not to intercept clicks on a given window
setButtonGrab :: Bool -> Window -> X ()
-setButtonGrab grab w = withDisplay $ \d -> io $
- if grab
+setButtonGrab grab w = do
+ pointerMode <- asks $ \c -> if clickJustFocuses (config c)
+ then grabModeAsync
+ else grabModeSync
+ withDisplay $ \d -> io $ if grab
then forM_ [button1, button2, button3] $ \b ->
grabButton d b anyModifier w False buttonPressMask
- grabModeSync grabModeSync none none
+ pointerMode grabModeSync none none
else ungrabButton d anyButton anyModifier w
-- ---------------------------------------------------------------------