summaryrefslogtreecommitdiffstats
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
commitaccd7087733c335b47d1282e4e06307366d2e7e4 (patch)
tree8c88b56d941721fc63520c88caf6e617403b5735 /XMonad/Operations.hs
parent7b5a7a40fe9066122c0de2c8455becaa4621b868 (diff)
downloadmetatile-accd7087733c335b47d1282e4e06307366d2e7e4.tar
metatile-accd7087733c335b47d1282e4e06307366d2e7e4.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
Diffstat (limited to 'XMonad/Operations.hs')
-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
-- ---------------------------------------------------------------------