Correct: GTK4 does not parse command line arguments, and since WM_CLASS is an X11-specific property, it should not be determined via command line anyway.
Well, I use i3 window manager, and there is a feature called “scratchpad” which lets you imitate “minimize” behavior of full-featured desktop environments. I wrote some custom scripts for different gtk3 apps doing roughly the following:
When key is pressed, check if the window with WM_CLASS property named app_scratchpad exists. If not, open app in scratchpad and set WM_CLASS property name to app_scratchpad.
If the window already exists and is mapped on the screen, unmap it (hide to scratchpad).
Else if the window exists but is unmapped, map and raise the window on the screen (pick from scratchpad).
This let me toggle show/hide behavior for specific apps by using keybindings. By using app_scratchpad as window property name I can then quickly raise that certain app’s window by using a keybinding related to it instead of cycling through the entire window stack searching for that window.
It’s definitely not a bug. The ability to set the WM_CLASS property from the toolkit onto unsuspecting applications was never really a good “feature” to begin with: just an historical accident of the early GTK.