summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMartin Perner <martin@perner.cc>2011-09-10 17:15:39 +0200
committerMartin Perner <martin@perner.cc>2011-09-10 17:30:18 +0200
commitf522e5e5158c53faef472752bdd59901cc704264 (patch)
tree36057984776297413c065fc3a0f6f1ed287c43f1
parentb2601191cf84efdd6d0e144385c82e9d3a45cd27 (diff)
downloadxmobar-f522e5e5158c53faef472752bdd59901cc704264.tar.gz
xmobar-f522e5e5158c53faef472752bdd59901cc704264.tar.bz2
Wrong value used to check for xrandr event
Didn't tested xrandr events with that event detection. Notify value is 0, the one used (keypress) is 1
-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