aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcrodjer <crodjer@gmail.com>2012-03-05 17:12:40 +0100
committercrodjer <crodjer@gmail.com>2012-03-05 17:12:40 +0100
commit85934e8253c3610ebf379ca9f87392d623a2f66b (patch)
tree742c0327dd69172314b120ece85614621fe11740
parent47245449d8aac3728e339e2123c77da37ed45dfc (diff)
downloadXMonadContrib-85934e8253c3610ebf379ca9f87392d623a2f66b.tar.gz
XMonadContrib-85934e8253c3610ebf379ca9f87392d623a2f66b.tar.xz
XMonadContrib-85934e8253c3610ebf379ca9f87392d623a2f66b.zip
ShowWName: Fix flash location by screen rectangle
Ignore-this: 83ec4cce2297efc6736a1fe55f44ee73 In case of using this hook with multiple monitors, the Tag flash was not following the screen's coordinates. This patch shifts the new window created for flash according to the Rectangle defined by the screen. darcs-hash:20120305161240-fbbbc-9eb5efe5d06780901c87e2db8e22015549f80076.gz
-rw-r--r--XMonad/Layout/ShowWName.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/XMonad/Layout/ShowWName.hs b/XMonad/Layout/ShowWName.hs
index d2f9096..ebca235 100644
--- a/XMonad/Layout/ShowWName.hs
+++ b/XMonad/Layout/ShowWName.hs
@@ -86,15 +86,15 @@ doShow (SWN True c Nothing ) r wrs = flashName c r wrs
doShow (SWN False _ _ ) _ wrs = return (wrs, Nothing)
flashName :: SWNConfig -> Rectangle -> [(a, Rectangle)] -> X ([(a, Rectangle)], Maybe (ShowWName a))
-flashName c (Rectangle _ _ wh ht) wrs = do
+flashName c (Rectangle sx sy wh ht) wrs = do
d <- asks display
n <- withWindowSet (return . S.currentTag)
f <- initXMF (swn_font c)
width <- textWidthXMF d f n
(as,ds) <- textExtentsXMF f n
let hight = as + ds
- y = (fi ht - hight + 2) `div` 2
- x = (fi wh - width + 2) `div` 2
+ y = fi sy + (fi ht - hight + 2) `div` 2
+ x = fi sx + (fi wh - width + 2) `div` 2
w <- createNewWindow (Rectangle (fi x) (fi y) (fi width) (fi hight)) Nothing "" True
showWindow w
paintAndWrite w f (fi width) (fi hight) 0 "" "" (swn_color c) (swn_bgcolor c) [AlignCenter] [n]