From 92b9d423dbe368ee28fc6c6259b669f23ef3a90b Mon Sep 17 00:00:00 2001 From: Andrea Rossato Date: Sun, 7 Oct 2007 18:38:25 +0200 Subject: Tabbed and XPrompt updated to lates Extras changes darcs-hash:20071007163825-32816-8ebe1d13dff1ac21304138a19b6ae883a54f71c7.gz --- Tabbed.hs | 26 +++++++++++--------------- XPrompt.hs | 5 ++--- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/Tabbed.hs b/Tabbed.hs index 53bc5eb..6f1cdf6 100644 --- a/Tabbed.hs +++ b/Tabbed.hs @@ -142,24 +142,20 @@ handleEvent ishr conf (TabState {tabsWindows = tws, scr = screen, Just x -> do focus x updateTab ishr conf fs width (thisw, x) Nothing -> return () - where - width = rect_width screen`div` fromIntegral (length tws) - -handleEvent ishr conf (TabState {tabsWindows = tws, scr = screen, fontS = fs }) - (AnyEvent {ev_window = thisw, ev_event_type = t }) --- expose - | thisw `elem` (map fst tws) && t == expose = do - updateTab ishr conf fs width (thisw, fromJust $ lookup thisw tws) - where - width = rect_width screen`div` fromIntegral (length tws) -handleEvent ishr conf (TabState {tabsWindows = tws, scr = screen, fontS = fs }) - (PropertyEvent {ev_window = thisw }) + where width = rect_width screen `div` fromIntegral (length tws) -- propertyNotify - | thisw `elem` (map snd tws) = do +handleEvent ishr conf (TabState {tabsWindows = tws, scr = screen, fontS = fs }) + (PropertyEvent {ev_window = thisw }) + | thisw `elem` (map snd tws) = do let tabwin = (fst $ fromJust $ find ((== thisw) . snd) tws, thisw) updateTab ishr conf fs width tabwin - where - width = rect_width screen`div` fromIntegral (length tws) + where width = rect_width screen `div` fromIntegral (length tws) +-- expose +handleEvent ishr conf (TabState {tabsWindows = tws, scr = screen, fontS = fs }) + (ExposeEvent {ev_window = thisw }) + | thisw `elem` (map fst tws) = do + updateTab ishr conf fs width (thisw, fromJust $ lookup thisw tws) + where width = rect_width screen `div` fromIntegral (length tws) handleEvent _ _ _ _ = return () initState :: TConf -> Rectangle -> [Window] -> X TabState diff --git a/XPrompt.hs b/XPrompt.hs index f092fa1..f4debb0 100644 --- a/XPrompt.hs +++ b/XPrompt.hs @@ -212,13 +212,12 @@ eventLoop action = do -- Main event handler handle :: KeyStroke -> Event -> XP () handle k@(ks,_) e@(KeyEvent {ev_event_type = t}) - | t == keyPress && ks == xK_Tab = do + | t == keyPress && ks == xK_Tab = do c <- getCompletions completionHandle c k e handle ks (KeyEvent {ev_event_type = t, ev_state = m}) | t == keyPress = keyPressHandle m ks -handle _ (AnyEvent {ev_event_type = t, ev_window = w}) - | t == expose = do +handle _ (ExposeEvent {ev_window = w}) = do st <- get when (win st == w) updateWindows eventLoop handle -- cgit v1.2.3