summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Xmobar.hs')
-rw-r--r--src/Xmobar.hs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/Xmobar.hs b/src/Xmobar.hs
index eb7a1dd..f0c00cb 100644
--- a/src/Xmobar.hs
+++ b/src/Xmobar.hs
@@ -103,6 +103,7 @@ eventLoop xc@(XConf d _ w fs c) vs = block $ do
-- event hanlder
handle _ ct (ConfigureEvent {ev_window = win}) = do
rootw <- rootWindow d (defaultScreen d)
+ putStrLn "Configure"
when (win == rootw) $ block $ do
killThread ct
destroyWindow d w
@@ -111,7 +112,13 @@ eventLoop xc@(XConf d _ w fs c) vs = block $ do
handle tvar _ (ExposeEvent {}) = runX xc (updateWin tvar)
- handle _ _ _ = return ()
+ -- this catches the RRScreenChangeNotify
+ handle _ ct _ = block $ do
+ putStrLn "ScreenChange"
+ killThread ct
+ destroyWindow d w
+ (r',w') <- createWin d fs c
+ eventLoop (XConf d r' w' fs c) vs
-- $command
@@ -141,6 +148,8 @@ createWin d fs c = do
(r,o) = setPosition (position c) srs (fi ht)
win <- newWindow d (defaultScreenOfDisplay d) rootw r o
selectInput d win (exposureMask .|. structureNotifyMask)
+ -- RRScreenChangeNotifyMask has the same value as keyPressMask
+ xrrSelectInput d rootw (keyPressMask)
setProperties r c d win srs
when (lowerOnStart c) (lowerWindow d win)
mapWindow d win