diff options
-rw-r--r-- | lib/Phi/X11.hs | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/lib/Phi/X11.hs b/lib/Phi/X11.hs index 2e3cb8a..b2b3c2c 100644 --- a/lib/Phi/X11.hs +++ b/lib/Phi/X11.hs @@ -30,7 +30,7 @@ import Phi.Phi import qualified Phi.Types as Phi import qualified Phi.Panel as Panel import qualified Phi.Widget as Widget -import Phi.Widget (Widget) +import Phi.Widget hiding (Display, handleMessage) import Phi.X11.Atoms import qualified Phi.Bindings.Util as Util @@ -39,19 +39,19 @@ data XConfig = XConfig { phiXScreenInfo :: !(Display -> IO [Rectangle]) } data PhiState w d = (Widget.Widget w d) => PhiState { phiRootImage :: !Surface - , phiPanels :: ![PanelState w d] - , phiRepaint :: !Bool - , phiShutdown :: !Bool - , phiShutdownHold :: !Int - } + , phiPanels :: ![PanelState w d] + , phiRepaint :: !Bool + , phiShutdown :: !Bool + , phiShutdownHold :: !Int + } data PanelState w d = (Widget.Widget w d) => PanelState { panelWindow :: !Window - , panelPixmap :: !Pixmap - , panelArea :: !Rectangle - , panelScreenArea :: !Rectangle - , panelWidget :: !w - , panelWidgetState :: !d - } + , panelPixmap :: !Pixmap + , panelArea :: !Rectangle + , panelScreenArea :: !Rectangle + , panelWidget :: !w + , panelWidgetState :: !d + } data PhiConfig = PhiConfig { phiPhi :: !Phi , phiPanelConfig :: !Panel.PanelConfig @@ -110,10 +110,11 @@ runPhi xconfig config widget = do dispmvar <- liftIO $ newMVar disp let screenPanels = zip screens panelWindows dispvar = Widget.Display dispmvar atoms screenPanels - widgetState <- liftIO $ Widget.initWidget widget phi dispvar + widget' = widget <~> separator 0 (if weight widget > 0 then 0 else 1) + widgetState <- liftIO $ Widget.initWidget widget' phi dispvar Widget.withDisplay dispvar $ \disp -> do - panels <- mapM (\(screen, window) -> createPanel disp window widget widgetState screen) screenPanels + panels <- mapM (\(screen, window) -> createPanel disp window widget' widgetState screen) screenPanels forM_ panels $ \panel -> do setPanelProperties disp panel |