command line options for WM_CLASS and WM_ROLE do not work

Bug #1695793 reported by Gregor Santner
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Terminator
New
Undecided
Unassigned

Bug Description

Data: Terminator 1.91, Arch Linux x64, XFCE 4.12

Setting WM_CLASS and/or WM_ROLE attributes via the available "-r"/"-c" option do not work.
Resolving the WM attributes always yields >>>WM_CLASS(STRING) = "terminator", "Terminator"<<< , supplied parameters are getting ignored. This makes window-lists/docks believe this is just another terminator window, and therefore it can't be distinguished from others.

Example call: terminator -c mocp -r mocp -x mocp
Should show: mocp as WM_CLASS and mocp as WM_ROLE
Current: "terminator", "Terminator"

See attachment.

Revision history for this message
Gregor Santner (gsantner) wrote :
Revision history for this message
Stephen Boddy (stephen-j-boddy) wrote :

See https://developer.gnome.org/gtk3/stable/GtkWindow.html#gtk-window-set-wmclass

First sentence: "Don't use this function." It is also deprecated in 3.22, so it will disappear completely at some point in the future (possibly 4.0).

So this option was removed in http://bazaar.launchpad.net/~gnome-terminator/terminator/gtk3/revision/1758

Instead we are told to use the set_role function, which should still be done and working. I'm not currently in a position to test it though, so I'll check that later.

Revision history for this message
Gregor Santner (gsantner) wrote :

Hm, thats somewhat dumb. That destroys the use of the StartUpWmClass attribute in FreeDesktop files.

Just asking, there must be some constructor that which leads to the Terminator WM_CLASS. Couldn't be the value set in there (with terminator as default of course) instead of using the deprecated setter?

Revision history for this message
Sean Dilda (seandilda) wrote :

I ran into the same issue. While not a fix, I found that if I can work around this with a symlink.

Just create a symlink with the name of the WM_CLASS you want that points to terminator. Call the symlink instead of terminator and it will update the WM_CLASS. This worked for me with gnome under wayland well enough to match to a .desktop file with StartupWMClass set

Revision history for this message
Francesco Minnocci (qwerty1214) wrote :

 I experience the same issue as OP on Ubuntu 18.04: WM_WINDOW_ROLE is respected, while WM_CLASS set via `--classname` is ignored.

 While I understand the dev's comment referring to gtk3 non-support of WM_CLASS, I also agree with OP that this function, although for limited use cases, is very useful when customizing .desktop files.

 Example use case: I want to use `terminator -c ncmpcpp` ncmpcpp` for the `exec` field of a FreeDesktop file, in order to set StartupWM_CLASS and display a custom icon an name in the Ubuntu dock (or any app launcher).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.