From 6fd5a380b46edd755118bfe385a99609c2b7c142 Mon Sep 17 00:00:00 2001 From: Adam Vogt Date: Tue, 3 Jan 2012 02:39:16 +0100 Subject: 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 --- XMonad/Operations.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'XMonad/Operations.hs') 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 -- --------------------------------------------------------------------- -- cgit v1.2.3