mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-01 04:31:52 -07:00
Tabbed: check if we really have a window to focus
This commit is contained in:
@@ -138,8 +138,10 @@ handleEvent :: Invisible Maybe Shrinker -> TConf -> TabState -> Event -> X ()
|
|||||||
handleEvent ishr conf (TabState {tabsWindows = tws, scr = screen, fontS = fs })
|
handleEvent ishr conf (TabState {tabsWindows = tws, scr = screen, fontS = fs })
|
||||||
(ButtonEvent {ev_window = thisw, ev_subwindow = thisbw, ev_event_type = t })
|
(ButtonEvent {ev_window = thisw, ev_subwindow = thisbw, ev_event_type = t })
|
||||||
| t == buttonPress, tl <- map fst tws, thisw `elem` tl || thisbw `elem` tl = do
|
| t == buttonPress, tl <- map fst tws, thisw `elem` tl || thisbw `elem` tl = do
|
||||||
focus (fromJust $ lookup thisw tws)
|
case lookup thisw tws of
|
||||||
updateTab ishr conf fs width (thisw, fromJust $ lookup thisw tws)
|
Just x -> do focus x
|
||||||
|
updateTab ishr conf fs width (thisw, x)
|
||||||
|
Nothing -> return ()
|
||||||
where
|
where
|
||||||
width = rect_width screen`div` fromIntegral (length tws)
|
width = rect_width screen`div` fromIntegral (length tws)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user