Unknown option --class

OS: Archlinux
DE: i3, X11

Hello!
I have already reported on GitLab, but it seems that the issue is not with gnome-calculator itself.

After upgrading gnome-calculator to version 42, which uses gtk4, it is impossible to set WM_CLASS window property because:

Unknown option --class
Unknown option --name

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.

What are you really trying to achieve?

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:

  1. 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.
  2. If the window already exists and is mapped on the screen, unmap it (hide to scratchpad).
  3. 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.

I’m not clear why this needs a custom class?

Yeah, actually, it is not needed, and I do it different way now. Just wanted to know is it a bug or a feature.

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.

Ok, thank you for the response!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.