summaryrefslogtreecommitdiffhomepage
path: root/src/XUtil.hsc
diff options
context:
space:
mode:
authorMartin Perner <martin@perner.cc>2011-09-07 13:09:52 +0200
committerMartin Perner <martin@perner.cc>2011-09-09 21:07:46 +0200
commitdbf4ea77dc318f5d3b68651eabc562cd6cefec51 (patch)
tree75baccb9efee2febac4837c8dfd5aa8df323f68f /src/XUtil.hsc
parent4fe99635e87c4f2262a27bf91c1ab6c7e3ee0988 (diff)
downloadxmobar-dbf4ea77dc318f5d3b68651eabc562cd6cefec51.tar.gz
xmobar-dbf4ea77dc318f5d3b68651eabc562cd6cefec51.tar.bz2
complete reword of the eventLoop
*) replaced window destroy and create with a reposition *) replaced the exception for redraw with an MVar *) put nextEvent into an own thread, communication over the MVar *) signal handlers for repositioning and screen swap Notes: *) getScreenInfo is a parameter of eventLoop because it blocks when there is an nextEvent waiting for an new event
Diffstat (limited to 'src/XUtil.hsc')
-rw-r--r--src/XUtil.hsc10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/XUtil.hsc b/src/XUtil.hsc
index 6511b10..cb0c89a 100644
--- a/src/XUtil.hsc
+++ b/src/XUtil.hsc
@@ -1,4 +1,4 @@
-{-# OPTIONS -fglasgow-exts #-}
+{-# LANGUAGE ForeignFunctionInterface #-}
-----------------------------------------------------------------------------
-- |
-- Module : XUtil
@@ -28,13 +28,15 @@ module XUtil
, fi
, withColors
, DynPixel(..)
- , xrrSelectInput
+ , xrrSelectInput
+ , xrrQueryExtension
) where
import Control.Concurrent
import Control.Monad.Trans
import Data.IORef
import Foreign
+import Foreign.C.Types
import Graphics.X11.Xlib hiding (textExtents, textWidth)
import qualified Graphics.X11.Xlib as Xlib (textExtents, textWidth)
import Graphics.X11.Xlib.Extras
@@ -263,3 +265,7 @@ setupLocale = return ()
#include <X11/extensions/Xrandr.h>
foreign import ccall unsafe "X11/extensions/Xrandr.h XRRSelectInput"
xrrSelectInput :: Display -> Window -> EventMask -> IO ()
+
+-- XRRQueryExtension
+foreign import ccall unsafe "X11/extensions/Xrandr.h XRRQueryExtension"
+ xrrQueryExtension :: Display -> Ptr CInt -> Ptr CInt -> IO (Bool)