summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-02-04 00:28:40 +0000
committerjao <jao@gnu.org>2022-02-04 00:28:40 +0000
commitab47eb31b532c232255b2c2385160510145e40ba (patch)
tree70f5f7faab080875b7879581f0ad21e543c1189b
parentd65979cc4fb0dc85f59b445a377958aa9569b934 (diff)
downloadxmobar-ab47eb31b532c232255b2c2385160510145e40ba.tar.gz
xmobar-ab47eb31b532c232255b2c2385160510145e40ba.tar.bz2
Xmobar.App.X11EventLoop -> Xmobar.X11.Loop
-rw-r--r--src/Xmobar/App/Main.hs4
-rw-r--r--src/Xmobar/X11/Loop.hs (renamed from src/Xmobar/App/X11EventLoop.hs)12
-rw-r--r--xmobar.cabal2
3 files changed, 9 insertions, 9 deletions
diff --git a/src/Xmobar/App/Main.hs b/src/Xmobar/App/Main.hs
index 6b20158..c660a88 100644
--- a/src/Xmobar/App/Main.hs
+++ b/src/Xmobar/App/Main.hs
@@ -29,13 +29,13 @@ import Control.Monad (unless)
import Xmobar.App.Config
import Xmobar.Config.Types
import Xmobar.Config.Parse
+import qualified Xmobar.X11.Loop as X11
import Xmobar.App.Opts (recompileFlag, verboseFlag, getOpts, doOpts)
-import Xmobar.App.X11EventLoop (x11Loop)
import Xmobar.App.TextEventLoop (textLoop)
import Xmobar.App.Compile (recompile, trace)
xmobar :: Config -> IO ()
-xmobar cfg = if textOutput cfg then textLoop cfg else x11Loop cfg
+xmobar cfg = if textOutput cfg then textLoop cfg else X11.loop cfg
configFromArgs :: Config -> IO Config
configFromArgs cfg = getArgs >>= getOpts >>= doOpts cfg . fst
diff --git a/src/Xmobar/App/X11EventLoop.hs b/src/Xmobar/X11/Loop.hs
index 850738e..840c16e 100644
--- a/src/Xmobar/App/X11EventLoop.hs
+++ b/src/Xmobar/X11/Loop.hs
@@ -16,7 +16,7 @@
--
------------------------------------------------------------------------------
-module Xmobar.App.X11EventLoop (x11Loop) where
+module Xmobar.X11.Loop (loop) where
import Prelude hiding (lookup)
import Graphics.X11.Xlib hiding (textExtents, textWidth, Segment)
@@ -59,7 +59,7 @@ import Xmobar.X11.Bitmap as Bitmap
import Xmobar.X11.Types
import Xmobar.System.Utils (safeIndex)
-import Xmobar.Run.Loop (initLoop, loop)
+import qualified Xmobar.Run.Loop as Loop
#ifndef THREADED_RUNTIME
import Xmobar.X11.Events(nextEvent')
@@ -73,8 +73,8 @@ runX :: XConf -> X () -> IO ()
runX xc f = runReaderT f xc
-- | Starts the main event loop and threads
-x11Loop :: Config -> IO ()
-x11Loop conf = do
+loop :: Config -> IO ()
+loop conf = do
initThreads
d <- openDisplay ""
fs <- initFont d (font conf)
@@ -82,7 +82,7 @@ x11Loop conf = do
let ic = Map.empty
to = textOffset conf
ts = textOffsets conf ++ replicate (length fl) (-1)
- loop conf $ \sig lock vars -> do
+ Loop.loop conf $ \sig lock vars -> do
(r,w) <- createWin d fs conf
startLoop (XConf d r w (fs :| fl) (to :| ts) ic conf) sig lock vars
@@ -95,7 +95,7 @@ startLoop xcfg@(XConf _ _ w _ _ _ _) sig pauser vs = do
#ifdef XFT
xftInitFtLibrary
#endif
- tv <- initLoop sig pauser vs
+ tv <- Loop.initLoop sig pauser vs
#ifdef THREADED_RUNTIME
_ <- forkOS (handle (handler "eventer") (eventer sig))
#else
diff --git a/xmobar.cabal b/xmobar.cabal
index f812872..70ce0d0 100644
--- a/xmobar.cabal
+++ b/xmobar.cabal
@@ -117,7 +117,6 @@ library
Xmobar.Run.Actions,
Xmobar.Run.Parsers,
Xmobar.Run.Loop,
- Xmobar.App.X11EventLoop,
Xmobar.App.TextEventLoop,
Xmobar.App.Config,
Xmobar.App.Main,
@@ -130,6 +129,7 @@ library
Xmobar.System.Signal,
Xmobar.System.Kbd,
Xmobar.X11.Events,
+ Xmobar.X11.Loop,
Xmobar.X11.Types,
Xmobar.X11.Text,
Xmobar.X11.Bitmap,