From 85934e8253c3610ebf379ca9f87392d623a2f66b Mon Sep 17 00:00:00 2001 From: crodjer Date: Mon, 5 Mar 2012 17:12:40 +0100 Subject: 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 --- XMonad/Layout/ShowWName.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'XMonad/Layout') 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] -- cgit v1.2.3