meh / rust-xcb-util

Rust bindings and wrappers for XCB utility functions.
MIT License
27 stars 17 forks source link

Treat null-terminator as optional for string properties. #9

Closed mjkillough closed 7 years ago

mjkillough commented 7 years ago

It seems many popular applications (Spotify, Chorome, urxvt) don't null terminate WM_NAME. Check if the final byte of strings is null and adjust the length accordingly.

This will affect properties like _NET_WM_DESKTOP_NAMES too which are arrays of strings. In the one WM I looked at (QTile), it didn't null-terminate the final element in the array either (i.e. it was 'desktop1\0desktop2\0desktop3'), so I think being more permissive about what we accept is a good thing.

meh commented 7 years ago

Merged, thanks!

mjkillough commented 7 years ago

Great - thanks a lot!