ice-wm / icewm

IceWM releases only, see Wiki
https://github.com/ice-wm/icewm/releases
Other
289 stars 16 forks source link

Skip "childs"/non-root windows from tray #125

Closed T-3B closed 1 year ago

T-3B commented 1 year ago

Basically, Audacious (a music player) can have 3 windows open: the root (or parent) one for display current playing song, an equalizer, and a playlist editor. They have of course the same name and class.

Is there a way to skip only the "child" windows (the equalizer and playlist editor)?

For now I can do it by running this command: icesh -c audacious -n " d’Audacious$" setTrayOption 0 skip (since by default I have them set to audacious.Audacious.tray: Exclusive in my ~/.icewm/winoptions). (In French, the equalizer and playlist editor windows can be differentiated by the parent one by the end of their names.)

But I really wish there was a way to automatize that. The big cons of my method are:

In ~/.icewm/preferences I already tried TaskBarTaskGrouping=1 and all other digits, without changes.

Is there a possible automated way ? The only other thing I know is that the "leader" or "parent" window has always a smaller ID. I was thinking about some option in the winoptions file I perhaps missed or something like that.

This is a screenshot when the different Audacious windows does not group in the system trays: original

And this is a screenshot once the command to manually skip/hide the "child" windows is executed:solved

gijsbers commented 1 year ago

No, the windows are too much alike. Because Audacious uses the same WM_CLASS for different windows, it should support the WM_WINDOW_ROLE property, so that we can discern what is what. The WM_WINDOW_ROLE property is defined in the ICCCM standard, to which all X11 clients should adhere. You can report this problem and this idea on https://github.com/audacious-media-player/audacious. It would also improve its support for session management. It would be a simple change and more people would benefit.

T-3B commented 1 year ago

This is the whole message I get:

$ icesh list prop WM_WINDOW_ROLE
0x200000f   0 55894 "Égaliseur d’Audacious": (audacious.Audacious) 275x14+1095+1036

So if I understand correctly, this is a problem exclusive to Audacious (because they do not provide any WM_WINDOW_ROLE) and not icewm ?

I am aware that a role can be used in the winoptions file, and that would be great.

Other than opening an issue in Audacious repo, any way to automate that task at this time ?

gijsbers commented 1 year ago

xprop | grep WM_WINDOW_ROLE is empty for Audacious. Please ask them to support this.

T-3B commented 1 year ago

Okay, thanks for your help.

I'll close this in about 12 hours, in order to let other people write their comments if they have other ideas.

In any case I'll ask Audacious devs to support WM_WINDOW_ROLE.

gijsbers commented 1 year ago

What happened? Did they agree?

T-3B commented 1 year ago

Sorry, still did not asked them. I'll do that this evening.

Stay tuned, as I will write a message here whenever I have an answer ;)

gijsbers commented 1 year ago

They can use the function gtk_window_set_role, which was designed for this purpose.

gijsbers commented 1 year ago

Interestingly, the Gimp uses it too, at 17 places:

app/actions/text-tool-commands.c:      gtk_window_set_role (GTK_WINDOW (dialog), "gimp-text-load-file");
app/actions/text-editor-commands.c:      gtk_window_set_role (GTK_WINDOW (dialog), "gimp-text-load-file");
app/actions/gradients-commands.c:      gtk_window_set_role (GTK_WINDOW (dialog), "gimp-gradient-save-pov");
app/actions/error-console-commands.c:      gtk_window_set_role (GTK_WINDOW (dialog), "gimp-save-errors");
app/actions/dashboard-commands.c:          gtk_window_set_role (GTK_WINDOW (dialog),
app/dialogs/vectors-import-dialog.c:  gtk_window_set_role (GTK_WINDOW (dialog), "gimp-vectors-import");
app/dialogs/vectors-export-dialog.c:  gtk_window_set_role (GTK_WINDOW (dialog), "gimp-vectors-export");
app/display/gimpimagewindow.c:  gtk_window_set_role (GTK_WINDOW (window), role);
app/display/gimpdisplayshell-layer-select.c:  gtk_window_set_role (GTK_WINDOW (layer_select->window), "gimp-layer-select");
app/widgets/gimpsettingsbox.c:  gtk_window_set_role (GTK_WINDOW (dialog), "gimp-import-export-settings");
app/widgets/gimperrordialog.c:  gtk_window_set_role (GTK_WINDOW (dialog), "gimp-message");
app/widgets/gimpcriticaldialog.c:  gtk_window_set_role (GTK_WINDOW (dialog), "gimp-critical");
libgimpwidgets/gimpfileentry.c:      gtk_window_set_role (GTK_WINDOW (chooser),
libgimpwidgets/gimpcolorprofilechooserdialog.c:  gtk_window_set_role (GTK_WINDOW (dialog), "gimp-profile-chooser-dialog");
plug-ins/common/animation-play.c:  gtk_window_set_role (GTK_WINDOW (window), "animation-playback");
plug-ins/ifs-compose/ifs-compose.c:  gtk_window_set_role (GTK_WINDOW (dialog), "ifscompose-message");
plug-ins/help-browser/dialog.c:  gtk_window_set_role (GTK_WINDOW (window), plug_in_binary);
T-3B commented 1 year ago

Thanks for your messages !

So, in order to open an issue for Audacious, I have to do it here: https://redmine.audacious-media-player.org/projects/audacious/issues I have to create an account, and to activate it by clicking some link in an automatic email. The problem is: I never received that mail (checked again and again, but no email in spam, nor a wrong email adress) for now 3 hours. I also asked them to send it again, without any change. We'll see if I get one soon :/

T-3B commented 1 year ago

Unfortunately, I did not receive any activation email... I tested with 2 different mail adresses (gmail and outlook), same results (even in spams). So for me the only thing I can do to contact them is to make a PR on their repo, aaaand... I just saw you did a PR ! Thanks a lot ! From what I see they are open to the idea and once the requested change made the PR will be merged. Sorry but I don't have enough programming skills to help you with that, all I can do is to thank you !

gijsbers commented 1 year ago

Thanks for your thanks and thanks for bringing this to my attention as I'm an audacious user too.

T-3B commented 1 year ago

For anyone looking for this and for reference, this is the config file needed to only have the main/"parent" Audacious window in tray icons:

$ cat ~/.icewm/winoptions
audacious.mainwindow.tray: Exclusive
audacious.equalizer.ignoreTaskBar: 1   
audacious.playlist.ignoreTaskBar: 1

A big thanks again to gijsbers !