Xfce Forum

Sub domains
 

You are not logged in.

#1 2021-02-22 05:53:54

xfceforumorg1220
Member
Registered: 2012-03-26
Posts: 26

Window Buttons Window Grouping Algorithm

Has anyone looked into how XFCE4's Panel Window Buttons group windows?  What did you find out? This is new to me, so suggestions would be helpful.

I've been exploring this. I thought it might just be WM_CLASS, but it appears to be more involved. I narrowed it down to tasklist-widget.c and the gnome library libwnck.

What I'd like to find answers to:

1. When "Window Grouping" is set to "Always", what determines how windows are grouped?

2. Can xfce4-terminal's be in different Window Button groups?

I couldn't get xfce4-terminals to be in separate groups. It doesn't seem to support GTK --class or --name.

libreoffice is the opposite. I could get libreoffice calc, writer, etc, to be in the same group if I changed the Window Title.

The .desktop key, StartupWMClass, didn't seem to change anything.

Source Snippet:

xfce4-panel-master/plugins/tasklist/tasklist-widget.c:4213

xfce_tasklist_group_button_add_window (XfceTasklistChild *group_child,
                                       XfceTasklistChild *window_child)
{
  panel_return_if_fail (group_child->type == CHILD_TYPE_GROUP);
  panel_return_if_fail (window_child->type != CHILD_TYPE_GROUP);
  panel_return_if_fail (WNCK_IS_CLASS_GROUP (group_child->class_group));
  panel_return_if_fail (WNCK_IS_WINDOW (window_child->window));
  panel_return_if_fail (window_child->class_group == group_child->class_group);
  panel_return_if_fail (XFCE_IS_TASKLIST (group_child->tasklist));
  panel_return_if_fail (g_slist_find (group_child->windows, window_child) == NULL);

Commands:
wmctrl -lpx
xprop WM_NAME WM_CLASS
xdotool

Reference:
- Desktop Location: Panel Preferences > Window Buttons > Window Grouping
- Desktop Doc: https://docs.xfce.org/xfce/xfce4-panel/tasklist
- .desktop Spec: https://specifications.freedesktop.org/ … atest.html
- Src: https://github.com/xfce-mirror/xfce4-pa … t-widget.c
- Lib Doc: https://developer.gnome.org/libwnck/stable/
- Lib Src: https://gitlab.gnome.org/GNOME/libwnck/

Last edited by xfceforumorg1220 (2021-02-22 05:54:10)

Offline

#2 2021-02-22 12:56:46

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,491

Re: Window Buttons Window Grouping Algorithm

xfceforumorg1220 wrote:

1. When "Window Grouping" is set to "Always", what determines how windows are grouped?

By class name.

2. Can xfce4-terminal's be in different Window Button groups?
I couldn't get xfce4-terminals to be in separate groups. It doesn't seem to support GTK --class or --name.

If you run:

xprop -f WM_CLASS 8s -set WM_CLASS Term

...and click on a terminal window it will change its class name. However, the tasklist plugin doesn't listen to class name changes, so you have to restart the panel to see the separate group/icon. And as you've noticed, xfce4-terminal doesn't currently support GTK --class functionality. Also, Xfce doesn't seem to support StartupWMClass.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2021-02-26 03:37:21

xfceforumorg1220
Member
Registered: 2012-03-26
Posts: 26

Re: Window Buttons Window Grouping Algorithm

Your command worked

    xprop -f WM_CLASS 8s -set WM_CLASS Term

However, when I went to restart the panel, I ran

    xfce4-panel -r

and the panel just went away and didn't restart. I had to start manually

    xfce4-panel &

All appears good :-)

Thank you.

Last edited by xfceforumorg1220 (2021-02-26 03:39:32)

Offline

#4 2021-03-22 02:32:54

haobug
Member
Registered: 2012-12-01
Posts: 2

Re: Window Buttons Window Grouping Algorithm

chromium app(shortcut created by click 3dots menu->More tools->Create shortcut)

for example:

WM_WINDOW_ROLE(STRING) = "pop-up"
WM_CLASS(STRING) = "crx_ljjphgcgdifmdfkcdmgpgifekifhgcka", "Chromium-browser"
WM_WINDOW_ROLE(STRING) = "browser"
WM_CLASS(STRING) = "chromium-browser", "Chromium-browser"

the chromium app window will be group into the same group of other Chromium window.
that is not what i want since we can distinct then by value of WM_CLASS(STRING) .

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.009 seconds, 7 queries executed - Memory usage: 534.33 KiB (Peak: 535.17 KiB) ]