From 7b5a7a40fe9066122c0de2c8455becaa4621b868 Mon Sep 17 00:00:00 2001 From: "conrad.irwin" Date: Wed, 25 May 2011 06:34:13 +0200 Subject: pass mouse clicks on to focused windows (experimental) Ignore-this: 6b75b18b41e855a3f64a423b929a7282 Originally: http://www.haskell.org/pipermail/xmonad/2008-June/005807.html darcs-hash:20110525043413-8d3c4-53c2eae69ff246b869f4c5a617d9c0bba885f49f --- XMonad/Main.hsc | 3 ++- XMonad/Operations.hs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/XMonad/Main.hsc b/XMonad/Main.hsc index 0d279f9..bd2ec0a 100644 --- a/XMonad/Main.hsc +++ b/XMonad/Main.hsc @@ -248,12 +248,13 @@ handle e@(ButtonEvent {ev_window = w,ev_event_type = t,ev_button = b }) | t == buttonPress = do -- If it's the root window, then it's something we -- grabbed in grabButtons. Otherwise, it's click-to-focus. + dpy <- asks display isr <- isRoot w m <- cleanMask $ ev_state e mact <- asks (M.lookup (m, b) . buttonActions) case mact of (Just act) | isr -> act $ ev_subwindow e - _ -> focus w + _ -> focus w >> io (allowEvents dpy replayPointer currentTime) broadcastMessage e -- Always send button events. -- entered a normal window: focus it if focusFollowsMouse is set to diff --git a/XMonad/Operations.hs b/XMonad/Operations.hs index 401a812..f2beea4 100644 --- a/XMonad/Operations.hs +++ b/XMonad/Operations.hs @@ -287,7 +287,7 @@ setButtonGrab grab w = withDisplay $ \d -> io $ if grab then forM_ [button1, button2, button3] $ \b -> grabButton d b anyModifier w False buttonPressMask - grabModeAsync grabModeSync none none + grabModeSync grabModeSync none none else ungrabButton d anyButton anyModifier w -- --------------------------------------------------------------------- -- cgit v1.2.3