diff options
author | Adam Vogt <vogt.adam@gmail.com> | 2012-01-03 02:39:16 +0100 |
---|---|---|
committer | Adam Vogt <vogt.adam@gmail.com> | 2012-01-03 02:39:16 +0100 |
commit | 6fd5a380b46edd755118bfe385a99609c2b7c142 (patch) | |
tree | 8c88b56d941721fc63520c88caf6e617403b5735 /XMonad/Operations.hs | |
parent | 415f11d534bdcb3d380bb3148a17d691e542ba05 (diff) | |
download | xmonad-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 'XMonad/Operations.hs')
-rw-r--r-- | XMonad/Operations.hs | 9 |
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 -- --------------------------------------------------------------------- |