I think I've discovered a subtle bug in the get_state logic introduced in commit 999ce64b5a4a8fe3a509a58128ebc2c36c5d2a27
Not sure if this a bug of the get_state function or in the meanwhile X have changed things.
The issue is twofold:
the X window attribute WM_NAME is of type STRING instead of UTF8_STRING; in case of a song with non ASCII chars the string is broken, ex. "Solstafir - Ã\302\206ra" instead of "Solstafir - Æra". DBUS always returns UTF-8 encoded strings so the ad check in get_state failed.
The WM_NAME X window variable is not very trustworth because it is of type STRING I think it should be changed to _NET_WM_NAME which is always UTF-8 encoded.
In my case I also had LC_ALL not set so the X variable _NET_WM_NAME was of type STRING instead of UTF8_STRING. WM_NAME - instead - cannot be fixed (AFAICS).
I could verify this querying the Spotify window for the WM_LOCALE_NAME variable that should be en_US.UTF-8
Hello,
I think I've discovered a subtle bug in the
get_state
logic introduced in commit 999ce64b5a4a8fe3a509a58128ebc2c36c5d2a27 Not sure if this a bug of theget_state
function or in the meanwhile X have changed things.The issue is twofold:
the X window attribute
WM_NAME
is of typeSTRING
instead ofUTF8_STRING
; in case of a song with non ASCII chars the string is broken, ex."Solstafir - Ã\302\206ra"
instead of"Solstafir - Æra"
. DBUS always returns UTF-8 encoded strings so the ad check inget_state
failed.The
WM_NAME
X window variable is not very trustworth because it is of typeSTRING
I think it should be changed to_NET_WM_NAME
which is always UTF-8 encoded.In my case I also had
LC_ALL
not set so the X variable_NET_WM_NAME
was of typeSTRING
instead ofUTF8_STRING
.WM_NAME
- instead - cannot be fixed (AFAICS). I could verify this querying the Spotify window for theWM_LOCALE_NAME
variable that should been_US.UTF-8
Anyway I'm testing these two fixes in my fork in commit https://github.com/apiraino/Spotify-AdKiller/commit/bac0258f19e672586db8f017cdd5e9f7601cc71d. Seems to work.