Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imprecise documentation of XMonad.ManageHook’s title and stringProperty #503

Closed
mgkurtz opened this issue Apr 26, 2024 · 5 comments
Closed

Comments

@mgkurtz
Copy link
Contributor

mgkurtz commented Apr 26, 2024

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.

@geekosaur
Copy link
Contributor

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.

@geekosaur
Copy link
Contributor

(I doubt the documentation for those has been changed since before ghc got proper UTF-8 support.)

@mgkurtz
Copy link
Contributor Author

mgkurtz commented Apr 27, 2024

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?

@slotThe
Copy link
Member

slotThe commented Apr 27, 2024

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?

Sounds good to me!

@slotThe
Copy link
Member

slotThe commented Apr 27, 2024

Closed via #504

@slotThe slotThe closed this as completed Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants