From dd8584af1ac7c2853c4db0ee2d1bfe1f71e62fde Mon Sep 17 00:00:00 2001 From: Tomas Janousek Date: Mon, 26 Apr 2021 11:45:17 +0100 Subject: Fix off-by-one in strut calculation for Static position MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pixel intervals in _NET_WM_STRUT_PARTIAL are closed, not open [1], so xmobar of width 1920 at x=0 needs to be encoded as ⟨0, 1919⟩, not ⟨0, 1920). The code already does this for Top/Bottom positioning, but Static has been buggy for years. [1]: https://specifications.freedesktop.org/wm-spec/1.5/ar01s05.html#idm46075117229424 Fixes: https://old.reddit.com/r/xmonad/comments/mynegr/xmobar_dual_monitor_bug/ Fixes: https://github.com/jaor/xmobar/issues/530 --- src/Xmobar/X11/Window.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Xmobar/X11/Window.hs b/src/Xmobar/X11/Window.hs index 8c3c698..796e213 100644 --- a/src/Xmobar/X11/Window.hs +++ b/src/Xmobar/X11/Window.hs @@ -175,7 +175,7 @@ getStaticStrutValues (Static cx cy cw ch) rwh where st = cy + ch sb = rwh - cy xs = cx -- a simple calculation for horizontal (x) placement - xe = xs + cw + xe = xs + cw - 1 getStaticStrutValues _ _ = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] drawBorder :: Border -> Int -> Display -> Drawable -> GC -> Pixel -- cgit v1.2.3