How can I change the `WM_CLASS` property of a Comp...
# compose-desktop
m
How can I change the
WM_CLASS
property of a Compose window, as used by window managers / task managers on Linux?
To answer myself: you can't and the 16 year old feature request in OpenJDK is unresolved: https://bugs.openjdk.org/browse/JDK-6528430
However JetBrains IDE's manage to do it, I assume it's a functionality of the special JetBrains Runtime?
m
Came here to post this and I see you actually found it earlier, nice. I did do some experimentation and found you can have different WM_CLASS for different windows if you just do the above before opening each window.
z
sorry i dont understand. how does that work in my app?
m
If you don't already have a reason to need a specific
WM_CLASS
, then you probably don't need this.
z
i think its needed for linux .desktop files so that the app isnt opened multiple times
m
You don't need to change it though, just use the automatic one for that. You can use
xprop WM_CLASS
to find what it is on your app.
z
WM_CLASS(STRING) = "MainKt", "MainKt" thats Meh. because lockscreen notifications in ubuntu display as "MainKt" which kinda is not really nice. (strangly enough normal notifications do display with a proper title)
m
That’s weird, WM_CLASS is not supposed to be user visible.
But yeah, you can change it with reflection.