mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-07-31 20:21:51 -07:00
getAtomName is now defined in the X11 library
This commit is contained in:
@@ -42,27 +42,12 @@ import Codec.Binary.UTF8.String
|
||||
import Data.Maybe (fromMaybe)
|
||||
import Data.Monoid
|
||||
import Foreign
|
||||
import Foreign.C.String
|
||||
import Foreign.C.Types
|
||||
import Numeric (showHex)
|
||||
import System.Exit
|
||||
import System.IO
|
||||
import System.Process
|
||||
|
||||
-- this should move into X11
|
||||
foreign import ccall unsafe "XGetAtomName"
|
||||
xGetAtomName :: Display -> Atom -> IO CString
|
||||
|
||||
getAtomName :: Display -> Atom -> IO (Maybe String)
|
||||
getAtomName d a = do
|
||||
n <- xGetAtomName d a
|
||||
if n == nullPtr
|
||||
then return Nothing
|
||||
else do
|
||||
n' <- peekCString n
|
||||
xFree n
|
||||
return $ Just n'
|
||||
|
||||
-- | Event hook to dump all received events. You should probably not use this
|
||||
-- unconditionally; it will produce massive amounts of output.
|
||||
debugEventsHook :: Event -> X All
|
||||
|
Reference in New Issue
Block a user