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/Main.hsc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'XMonad/Main.hsc') diff --git a/XMonad/Main.hsc b/XMonad/Main.hsc index bd2ec0a..c459f14 100644 --- a/XMonad/Main.hsc +++ b/XMonad/Main.hsc @@ -253,8 +253,11 @@ handle e@(ButtonEvent {ev_window = w,ev_event_type = t,ev_button = b }) m <- cleanMask $ ev_state e mact <- asks (M.lookup (m, b) . buttonActions) case mact of - (Just act) | isr -> act $ ev_subwindow e - _ -> focus w >> io (allowEvents dpy replayPointer currentTime) + Just act | isr -> act $ ev_subwindow e + _ -> do + focus w + ctf <- asks (clickJustFocuses . config) + unless ctf $ io (allowEvents dpy replayPointer currentTime) broadcastMessage e -- Always send button events. -- entered a normal window: focus it if focusFollowsMouse is set to -- cgit v1.2.3