summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorTomas Janousek <tomi@nomi.cz>2021-04-26 11:45:17 +0100
committerTomas Janousek <tomi@nomi.cz>2021-04-26 14:17:37 +0100
commitdd8584af1ac7c2853c4db0ee2d1bfe1f71e62fde (patch)
tree0b1b13faf69e4fe3bd0e0c4ed02fde63e55457a3 /src
parent82461417abbcd2e03e4329d68df4a15866885dd2 (diff)
downloadxmobar-dd8584af1ac7c2853c4db0ee2d1bfe1f71e62fde.tar.gz
xmobar-dd8584af1ac7c2853c4db0ee2d1bfe1f71e62fde.tar.bz2
Fix off-by-one in strut calculation for Static position
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
Diffstat (limited to 'src')
-rw-r--r--src/Xmobar/X11/Window.hs2
1 files changed, 1 insertions, 1 deletions
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