diff options
author | jao <jao@gnu.org> | 2022-09-26 03:52:56 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2022-09-26 03:52:56 +0100 |
commit | f946b9c37b39a1b46bfe6433434f951ece531d94 (patch) | |
tree | aaccadcf6efcbc05c6f09c83a640b66b457d0ef6 /src/Xmobar/X11 | |
parent | 579b787c66124c1bc67dfa7a4ad00f3a8e3611cb (diff) | |
download | xmobar-f946b9c37b39a1b46bfe6433434f951ece531d94.tar.gz xmobar-f946b9c37b39a1b46bfe6433434f951ece531d94.tar.bz2 |
more little import clean ups
Diffstat (limited to 'src/Xmobar/X11')
-rw-r--r-- | src/Xmobar/X11/Events.hs | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/Xmobar/X11/Events.hs b/src/Xmobar/X11/Events.hs index 4334f6b..fbd2bd0 100644 --- a/src/Xmobar/X11/Events.hs +++ b/src/Xmobar/X11/Events.hs @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- | -- Module: Xmobar.X11.Events --- Copyright: (c) 2018 Jose Antonio Ortega Ruiz +-- Copyright: (c) 2018, 2022 Jose Antonio Ortega Ruiz -- License: BSD3-style (see LICENSE) -- -- Maintainer: jao@gnu.org @@ -17,20 +17,19 @@ module Xmobar.X11.Events(nextEvent') where -import Control.Concurrent -import System.Posix.Types (Fd(..)) +import qualified Control.Concurrent as C +import qualified System.Posix.Types as T -import Graphics.X11.Xlib ( - Display(..), XEventPtr, nextEvent, pending, connectionNumber) +import qualified Graphics.X11.Xlib as X -- | A version of nextEvent that does not block in foreign calls. -nextEvent' :: Display -> XEventPtr -> IO () +nextEvent' :: X.Display -> X.XEventPtr -> IO () nextEvent' d p = do - pend <- pending d + pend <- X.pending d if pend /= 0 - then nextEvent d p + then X.nextEvent d p else do - threadWaitRead (Fd fd) + C.threadWaitRead (T.Fd fd) nextEvent' d p where - fd = connectionNumber d + fd = X.connectionNumber d |