From c71bff82345401c39b203bccbc7667b819520f21 Mon Sep 17 00:00:00 2001 From: David Roundy Date: Mon, 4 Feb 2008 02:05:36 +0100 Subject: enable button click for focus in tabbed. Note that this patch doesn't work with Thu Dec 27 03:03:56 EST 2007 Spencer Janssen * Broadcast button events to all layouts, fix for issue #111 but this isn't a regression, since button events have never worked with tabbed and this change. darcs-hash:20080204010536-72aca-3e6f9c697f8e6e26931850d84b56b3f5de917f55.gz --- XMonad/Layout/Decoration.hs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'XMonad/Layout/Decoration.hs') diff --git a/XMonad/Layout/Decoration.hs b/XMonad/Layout/Decoration.hs index 4d20ac1..aa3244b 100644 --- a/XMonad/Layout/Decoration.hs +++ b/XMonad/Layout/Decoration.hs @@ -176,8 +176,16 @@ handleEvent :: Shrinker s => s -> Theme -> DecorationState -> Event -> X () handleEvent sh c (DS dwrs fs) e | PropertyEvent {ev_window = w} <- e, w `elem` (map (fst . fst) dwrs) = updateDecos sh c fs dwrs | ExposeEvent {ev_window = w} <- e, w `elem` (map (fst . snd) dwrs) = updateDecos sh c fs dwrs + | ButtonEvent {ev_window = w,ev_event_type = t} <- e, + t == buttonPress, + Just ((mainw,_),_) <- lookFor w dwrs = focus mainw handleEvent _ _ _ _ = return () +lookFor :: Window -> [(OrigWin,DecoWin)] -> Maybe (OrigWin,DecoWin) +lookFor w ((x,(w',y)):zs) | w == w' = Just (x,(w',y)) + | otherwise = lookFor w zs +lookFor _ [] = Nothing + getDWs :: [(OrigWin,DecoWin)] -> [Window] getDWs = map (fst . snd) -- cgit v1.2.3