summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTomas Janousek <tomi@nomi.cz>2021-04-27 14:19:53 +0100
committerTomas Janousek <tomi@nomi.cz>2021-04-27 14:39:14 +0100
commit90847c6b79cb536c7ce6bdf4250fd43110f8f8c3 (patch)
tree866872a9acb80cb239063fccbe5ac58c9649f288
parentaced6fe0c2a033dcbb6a1a75bd99ab79d1bc5463 (diff)
downloadxmobar-90847c6b79cb536c7ce6bdf4250fd43110f8f8c3.tar.gz
xmobar-90847c6b79cb536c7ce6bdf4250fd43110f8f8c3.tar.bz2
Revert "Conditional encoding …" and "Avoid double utf8 encoding" (#482)
This reverts commits c6669e26e1 (partially; changelog entry kept), 73e02934d6, 78efa5900a. These commits were introduced as a workaround for a double UTF-8 encoding bug in xmonad-contrib which itself was meant to be a fix/workaround for another issue. We have now identified the underlying issue and fixed it right at the root, so this entire cascade of hacky (and wrong) workarounds can be safely reverted. Thankfully, none of the xmonad-contrib hacks made it into a release, so there's no backward compat to worry about. Should anyone be interested in the details, https://github.com/xmonad/xmonad-contrib/commit/63e31ccd8d2865863778207b679f806941bf2788 provides a summary and links to all the related issues and PRs. Related: https://github.com/jaor/xmobar/pull/482 Related: https://github.com/jaor/xmobar/issues/476 Related: https://github.com/xmonad/xmonad-contrib/commit/63e31ccd8d2865863778207b679f806941bf2788 Related: https://github.com/xmonad/xmonad-contrib/pull/471 Related: https://github.com/xmonad/xmonad-contrib/issues/377
-rw-r--r--changelog.md3
-rw-r--r--src/Xmobar/X11/MinXft.hsc8
2 files changed, 4 insertions, 7 deletions
diff --git a/changelog.md b/changelog.md
index 82aa5d9..072932e 100644
--- a/changelog.md
+++ b/changelog.md
@@ -5,6 +5,9 @@ _Bug fixes_
- Fix off-by-one in strut calculation for `Static` position which reserved
space for the panel than necessary and caused issues in some multi-head
setups (fixes #530).
+ - Revert the double-UTF-8 encoding workarounds of 0.36 (#482), as they're no
+ longer necessary with xmonad-contrib master, and aren't needed with any
+ released version of xmonad-contrib either.
## Version 0.37 (November, 2020)
diff --git a/src/Xmobar/X11/MinXft.hsc b/src/Xmobar/X11/MinXft.hsc
index d6861e6..e593da0 100644
--- a/src/Xmobar/X11/MinXft.hsc
+++ b/src/Xmobar/X11/MinXft.hsc
@@ -161,16 +161,10 @@ withAXftDraw d p v c act = do
foreign import ccall "XftDrawStringUtf8"
cXftDrawStringUtf8 :: AXftDraw -> AXftColor -> AXftFont -> CInt -> CInt -> Ptr (#type FcChar8) -> CInt -> IO ()
--- Fixes https://github.com/jaor/xmobar/issues/476
-utf8EncodeString :: Num b => String -> [b]
-utf8EncodeString str = if UTF8.isUTF8Encoded str
- then map (fi . ord) str
- else map fi (UTF8.encode str)
-
drawXftString :: (Integral a1, Integral a) =>
AXftDraw -> AXftColor -> AXftFont -> a -> a1 -> String -> IO ()
drawXftString d c f x y string =
- withArrayLen (utf8EncodeString string)
+ withArrayLen (map fi (UTF8.encode string))
(\len ptr -> cXftDrawStringUtf8 d c f (fi x) (fi y) ptr (fi len))
drawXftString' :: AXftDraw ->