Imprecise documentation of `XMonad.ManageHook`’s `title` and `stringProperty`
Closed this issue · 5 comments
I wanted to access the WM_NAME
window property, did not notice that title
does just that and thus used stringProperty "WM_NAME"
. Alas, when my window titles contained unicode characters, stringProperty
broke down. I would thus expect title
to refer to WM_NAME
in its documentation and stringProperty
to refer to ASCII strings in their documentation.
Note: if someone needs utf8 support for window properties besides WM_NAME
, that could be built via Graphics.X11.Xlib.Extras.getTextProperty
or by making rawGetWindowProperty
a little more flexible.
title
is more complicated than WM_NAME
: as you noticed, WM_NAME
contains 8-bit characters (the local ISO8859 character set), the UTF-8 title is in _NET_WM_NAME
which title
tries before WM_NAME
.
stringProperty
is only reliable with ISO8859.
(I doubt the documentation for those has been changed since before ghc got proper UTF-8 support.)
stringProperty
is only reliable with ISO8859.
Not even that: getWindowProperty8
results in [CChar]
and on systems where CChar
is signed, the conversion toEnum . fromEnum
is a partial CChar → Char
function, resulting in an exception for non-ASCII characters.
(I doubt the documentation for those has been changed since before ghc got proper UTF-8 support.)
I see. Would it be fine, if I create a little PR to update the title
doc with references to WM_NAME
, _NET_WM_NAME
, and mention the restriction to ASCII for stringProperty
?
I see. Would it be fine, if I create a little PR to update the
title
doc with references toWM_NAME
,_NET_WM_NAME
, and mention the restriction to ASCII forstringProperty
?
Sounds good to me!