From 80b7c600635c2e21bcbdd001ed25cc0b6848a0b7 Mon Sep 17 00:00:00 2001 From: Stefan O'Rear Date: Sat, 9 Jun 2007 20:58:35 +0200 Subject: Give refresh sole responsibility for establishing window properties (-3 loc) darcs-hash:20070609185835-e3110-4561eca8bf83e9d05d90cdd75bc1ddce5855087f --- Main.hs | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'Main.hs') diff --git a/Main.hs b/Main.hs index aaa4970..ca7b9bd 100644 --- a/Main.hs +++ b/Main.hs @@ -28,7 +28,6 @@ import Graphics.X11.Xinerama (getScreenInfo) import XMonad import Config -import StackSet (new, floating, member) import qualified StackSet as W import Operations @@ -52,7 +51,7 @@ main = do let winset | ("--resume" : s : _) <- args , [(x, "")] <- reads s = x - | otherwise = new (fromIntegral workspaces) (fromIntegral $ length xinesc) + | otherwise = W.new (fromIntegral workspaces) (fromIntegral $ length xinesc) safeLayouts = case defaultLayouts of [] -> (full, []); (x:xs) -> (x,xs) cf = XConf @@ -80,19 +79,11 @@ main = do sync dpy False ws <- scan dpy rootw -- on the resume case, will pick up new windows + -- We mark the initial state as having all workspaces visible to + -- defeat the delta code in refresh. allocaXEvent $ \e -> - runX cf st $ do - - -- walk workspace, resetting X states/mask for windows - -- TODO, general iterators for these lists. - sequence_ [ setInitialProperties w >> reveal w - | wk <- map W.workspace (W.current winset : W.visible winset) - , w <- W.integrate (W.stack wk) ] - - sequence_ [ setInitialProperties w >> hide w - | wk <- W.hidden winset - , w <- W.integrate (W.stack wk) ] - + runX cf st{ windowset = allVisible winset } $ do + windows $ \_st -> winset mapM_ manage ws -- find new windows when logging $ withWindowSet (io . putStrLn . serial) @@ -100,6 +91,7 @@ main = do forever $ handle =<< io (nextEvent dpy e >> getEvent e) where forever a = a >> forever a + allVisible ss = ss{ W.hidden=[], W.visible = W.visible ss ++ [ W.Screen s (S 0) | s <- W.hidden ss ] } -- --------------------------------------------------------------------- -- IO stuff. Doesn't require any X state @@ -202,7 +194,7 @@ handle e@(ConfigureRequestEvent {ev_window = w}) = withDisplay $ \dpy -> do ws <- gets windowset wa <- io $ getWindowAttributes dpy w - if M.member w (floating ws) || not (member w ws) + if M.member w (W.floating ws) || not (W.member w ws) then do io $ configureWindow dpy w (ev_value_mask e) $ WindowChanges { wc_x = ev_x e , wc_y = ev_y e @@ -211,7 +203,7 @@ handle e@(ConfigureRequestEvent {ev_window = w}) = withDisplay $ \dpy -> do , wc_border_width = fromIntegral borderWidth , wc_sibling = ev_above e , wc_stack_mode = ev_detail e } - when (member w ws) (float w) + when (W.member w ws) (float w) else io $ allocaXEvent $ \ev -> do setEventType ev configureNotify setConfigureEvent ev w w -- cgit v1.2.3