summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Xmobar.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Xmobar.hs b/src/Xmobar.hs
index c5613a6..efc50e8 100644
--- a/src/Xmobar.hs
+++ b/src/Xmobar.hs
@@ -102,14 +102,15 @@ eventLoop xcfg@(XConf d _ w fs _) vs = do
alloca $ \ptrEventBase ->
alloca $ \ptrErrorBase ->
allocaXEvent $ \e -> do
- _ <- xrrQueryExtension d ptrEventBase ptrErrorBase
- xrrEventBase <- peek ptrEventBase
dpy <- openDisplay ""
- -- keyPressMask is the same value as RRScreenChangeNotify
+ -- keyPressMask is the same value as RRScreenChangeNotifyMask
xrrSelectInput dpy (defaultRootWindow dpy) keyPressMask
selectInput dpy w (exposureMask .|. structureNotifyMask)
+ _ <- xrrQueryExtension dpy ptrEventBase ptrErrorBase
+ xrrEventBase <- peek ptrEventBase
+
forever $ do
nextEvent dpy e
ev <- getEvent e
@@ -117,8 +118,8 @@ eventLoop xcfg@(XConf d _ w fs _) vs = do
ConfigureEvent {} -> putMVar signal Reposition
ExposeEvent {} -> putMVar signal Wakeup
_ ->
- -- keyPressMask is the same value as RRScreenChangeNotify
- when ( (fromIntegral (ev_event_type ev) - xrrEventBase) == fromIntegral keyPressMask)
+ -- 0 is the value of RRScreenChangeNotify
+ when ( (fromIntegral (ev_event_type ev) - xrrEventBase) == 0)
$ putMVar signal Reposition