summaryrefslogtreecommitdiffstats
path: root/lib/Phi/Widgets/Systray.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Phi/Widgets/Systray.hs')
-rw-r--r--lib/Phi/Widgets/Systray.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Phi/Widgets/Systray.hs b/lib/Phi/Widgets/Systray.hs
index 662c6a7..7e7ec63 100644
--- a/lib/Phi/Widgets/Systray.hs
+++ b/lib/Phi/Widgets/Systray.hs
@@ -55,6 +55,8 @@ instance Widget Systray SystrayState () where
lastReset <- newIORef 0
return $ SystrayState phi (head . getScreens $ dispvar) 0 lastReset []
+ initCache _ = ()
+
minSize _ (SystrayState _ systrayScreen _ _ icons) height screen = case True of
_ | screen == systrayScreen -> max 0 $ (length icons)*(height+2)-1
| otherwise -> 0
@@ -63,13 +65,13 @@ instance Widget Systray SystrayState () where
render Systray (SystrayState phi systrayScreen reset lastResetRef icons) x y w h screen = do
when (screen == systrayScreen) $ do
- lastReset <- readIORef lastResetRef
- writeIORef lastResetRef reset
+ lastReset <- liftIO $ readIORef lastResetRef
+ liftIO $ writeIORef lastResetRef reset
forM_ (zip [0..] icons) $ \(i, SystrayIconState midParent window) -> do
let x' = x + i*(h+2)
sendMessage phi $ RenderIcon midParent window x' y h h (lastReset /= reset)
- surface <- createImageSurface FormatARGB32 w h
+ surface <- liftIO $ createImageSurface FormatARGB32 w h
renderWith surface $ do
setOperator OperatorClear
paint