aboutsummaryrefslogtreecommitdiffstats
path: root/Tabbed.hs
diff options
context:
space:
mode:
authorAndrea Rossato <andrea.rossato@unibz.it>2007-10-05 13:17:33 +0200
committerAndrea Rossato <andrea.rossato@unibz.it>2007-10-05 13:17:33 +0200
commit8d147b9c3d6293f3feccb31b165cf945142d70a2 (patch)
treee53d6479fe880db4e4d12147121d30d2ca527d06 /Tabbed.hs
parent799006625fe734d40eb3defd7ba4b14f6a720177 (diff)
downloadXMonadContrib-8d147b9c3d6293f3feccb31b165cf945142d70a2.tar.gz
XMonadContrib-8d147b9c3d6293f3feccb31b165cf945142d70a2.tar.xz
XMonadContrib-8d147b9c3d6293f3feccb31b165cf945142d70a2.zip
Tabbed: check if we really have a window to focus
darcs-hash:20071005111733-32816-6e026a39a1f807302223547b3ce2855ef844d520.gz
Diffstat (limited to 'Tabbed.hs')
-rw-r--r--Tabbed.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/Tabbed.hs b/Tabbed.hs
index 689e4a6..a93f7b4 100644
--- a/Tabbed.hs
+++ b/Tabbed.hs
@@ -138,8 +138,10 @@ handleEvent :: Invisible Maybe Shrinker -> TConf -> TabState -> Event -> X ()
handleEvent ishr conf (TabState {tabsWindows = tws, scr = screen, fontS = fs })
(ButtonEvent {ev_window = thisw, ev_subwindow = thisbw, ev_event_type = t })
| t == buttonPress, tl <- map fst tws, thisw `elem` tl || thisbw `elem` tl = do
- focus (fromJust $ lookup thisw tws)
- updateTab ishr conf fs width (thisw, fromJust $ lookup thisw tws)
+ case lookup thisw tws of
+ Just x -> do focus x
+ updateTab ishr conf fs width (thisw, x)
+ Nothing -> return ()
where
width = rect_width screen`div` fromIntegral (length tws)