From eca887df7c5e71606e6e0f80d48067e1ebdf5159 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 29 Aug 2011 15:34:56 +0200 Subject: Don't use the widget definition as a part of the render cache state --- lib/Phi/Widgets/Clock.hs | 6 +++--- lib/Phi/Widgets/Systray.hs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/Phi/Widgets') diff --git a/lib/Phi/Widgets/Clock.hs b/lib/Phi/Widgets/Clock.hs index e232ef5..9282432 100644 --- a/lib/Phi/Widgets/Clock.hs +++ b/lib/Phi/Widgets/Clock.hs @@ -42,7 +42,7 @@ data ClockState = ClockState !ZonedTime deriving (Show, Eq) data ClockMessage = UpdateTime !ZonedTime deriving (Show, Typeable) -instance Widget Clock ClockState (RenderCache Clock ClockState) where +instance Widget Clock ClockState (RenderCache ClockState) where initWidget (Clock _) phi _ _ = do forkIO $ forever $ do time <- getZonedTime @@ -54,7 +54,7 @@ instance Widget Clock ClockState (RenderCache Clock ClockState) where time <- getZonedTime return $ ClockState time - initCache _ = createRenderCache $ \(Clock config) (ClockState time) _ _ w h _ -> do + initCache (Clock config) = createRenderCache $ \(ClockState time) _ _ w h _ -> do let (r, g, b, a) = fontColor config str = formatTime defaultTimeLocale (clockFormat config) time setSourceRGBA r g b a @@ -78,7 +78,7 @@ instance Widget Clock ClockState (RenderCache Clock ClockState) where minSize (Clock config) _ _ _ = clockSize config - render = renderCached + render _ = renderCached handleMessage _ priv m = case (fromMessage m) of Just (UpdateTime time) -> ClockState time diff --git a/lib/Phi/Widgets/Systray.hs b/lib/Phi/Widgets/Systray.hs index c419426..27a5e34 100644 --- a/lib/Phi/Widgets/Systray.hs +++ b/lib/Phi/Widgets/Systray.hs @@ -48,14 +48,14 @@ data SystrayMessage = AddIcon !Window !Window | RemoveIcon !Window | RenderIcon deriving (Show, Typeable) -instance Widget Systray SystrayState (RenderCache Systray SystrayState) where +instance Widget Systray SystrayState (RenderCache SystrayState) where initWidget (Systray) phi dispvar screens = do phi' <- dupPhi phi forkIO $ systrayRunner phi' dispvar $ snd . head $ screens return $ SystrayState phi (fst . head $ screens) 0 [] - initCache _ = createRenderCache $ \Systray (SystrayState phi systrayScreen reset icons) x y w h screen -> do + initCache _ = createRenderCache $ \(SystrayState phi systrayScreen reset icons) x y w h screen -> do when (screen == systrayScreen) $ do forM_ (zip [0..] icons) $ \(i, SystrayIconState midParent window) -> do let x' = x + i*(h+2) @@ -70,7 +70,7 @@ instance Widget Systray SystrayState (RenderCache Systray SystrayState) where weight _ = 0 - render = renderCached + render _ = renderCached handleMessage _ priv@(SystrayState phi screen reset icons) m = case (fromMessage m) of -- cgit v1.2.3