summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJochen Keil <jochen.keil@gmail.com>2012-09-01 21:46:46 +0200
committerJochen Keil <jochen.keil@gmail.com>2012-09-01 21:46:46 +0200
commit2b27a08668461ab83c2a4d2c084ed7ae18c965b0 (patch)
tree623d031f4d8b9064b33e6aa0b860fc62065bb7a5
parent8ccd5aa759175d204dccd0b580a3477ab23747f2 (diff)
downloadxmobar-2b27a08668461ab83c2a4d2c084ed7ae18c965b0.tar.gz
xmobar-2b27a08668461ab83c2a4d2c084ed7ae18c965b0.tar.bz2
Set StrutValues from showWindow
This is superior to calling the repositionWin function. It will only set the StrutValues and avoid additional work. This means, that extra parameters need to be passed down to showWindow. However, that is not a problem here.
-rw-r--r--src/Window.hs10
-rw-r--r--src/Xmobar.hs7
2 files changed, 11 insertions, 6 deletions
diff --git a/src/Window.hs b/src/Window.hs
index 7ff1ffe..29e1516 100644
--- a/src/Window.hs
+++ b/src/Window.hs
@@ -162,8 +162,14 @@ hideWindow d w = do
unmapWindow d w
sync d False
-showWindow :: Display -> Window -> IO ()
-showWindow d w = mapWindow d w >> sync d False
+showWindow :: Rectangle -> Config -> Display -> Window -> IO ()
+showWindow r cfg d w = do
+ srs <- getScreenInfo d
+ a <- internAtom d "_NET_WM_STRUT_PARTIAL" False
+ c <- internAtom d "CARDINAL" False
+ changeProperty32 d w a c propModeReplace $ map fi $
+ getStrutValues r (position cfg) (getRootWindowHeight srs)
+ mapWindow d w >> sync d False
isMapped :: Display -> Window -> IO Bool
isMapped d w = fmap ism $ getWindowAttributes d w
diff --git a/src/Xmobar.hs b/src/Xmobar.hs
index a74db7d..d2d29ad 100644
--- a/src/Xmobar.hs
+++ b/src/Xmobar.hs
@@ -132,7 +132,7 @@ checker tvar ov vs signal = do
-- | Continuously wait for a signal from a thread or a interrupt handler
eventLoop :: TVar [String] -> XConf -> TMVar SignalType -> IO ()
-eventLoop tv xc@(XConf d _ w fs cfg) signal = do
+eventLoop tv xc@(XConf d r w fs cfg) signal = do
typ <- atomically $ takeTMVar signal
case typ of
Wakeup -> do
@@ -167,9 +167,8 @@ eventLoop tv xc@(XConf d _ w fs cfg) signal = do
reveal t | t == 0 =
if isPersistent
then do
- r' <- repositionWin d w fs cfg
- showWindow d w
- eventLoop tv (XConf d r' w fs cfg) signal
+ showWindow r cfg d w
+ eventLoop tv xc signal
else eventLoop tv xc signal
| otherwise = do
void $ forkIO