Skip to content

Conversation

@rmottola
Copy link
Member

@rmottola rmottola commented Dec 20, 2023

XFCE windowmanager groups in the task bar windows when there are many for one application. What I found is that with two or more GNUstep applications, everything was put into a "GNUstep" item, different from the expected experience
After some trial-and error using xprops on various apps (internal XFCe,, GTK tools, Firefox...) I found out the issue is the WM_CLASS atoms, which consists of two strings

for most application they were set like this:
"app name", "App Name"

for some others, like this: "org.gnome.appname", "AppName"

or even a functional name, e.g Firefox has: "Navigator", "Firefox" which I bet is a heritage of when there was Navigator, Mail, Composer, Chat

we were setting "AppName", "GNUstep"

Since in the place I only have NSProcessInfo, (using the domain or a functional name like Firefox).. so now we can set e.g. "Ink", "Ink".
At a first test, it works in XFCE!

I wonder:

  • Is/Was "GNUstep" as class used somewhere or for other WMs?
  • Do other places where res_class is set to GNUstep be also changed?

@rmottola rmottola requested a review from fredkiefer as a code owner December 20, 2023 09:04
@rmottola rmottola requested review from fredkiefer and removed request for fredkiefer December 20, 2023 09:04
@dblsaiko
Copy link

How about setting it to the value of CFBundleIdentifier? That seems to be the closest to "org.gnome.appname".

@rmottola
Copy link
Member Author

rmottola commented Mar 6, 2024

How about setting it to the value of CFBundleIdentifier? That seems to be the closest to "org.gnome.appname".

That detail seems only to be done for that GNOME app, you may try to inspect random apps you are running.

Furthermore, i don't know how to access in an efficient way the CFBundleIdentifier in XGServerWindow

@rmottola
Copy link
Member Author

rmottola commented Mar 6, 2024

@fredkiefer do we use res_class for anything else?

We left this stale... would be nice to make it before release.

Copy link
Member

@fredkiefer fredkiefer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this change is fine. What we should think about is, what we set the variable res_name to. There is no use in setting both variables to the same value. One should check with other X11 applications what is the current usage.

@rfm
Copy link
Contributor

rfm commented Dec 22, 2025

i don't know how to access in an efficient way the CFBundleIdentifier in XGServerWindow
You should be able to do that with [[NSBundle mainBundle] bundleIdentifier], with a fallback to [[NSProcessInfo processInfo] processName] if the bundle identifier is nil.

what we set the variable res_name to
According to chatgpt, res_name is used for resource lookup (from .Xresources and .Xdefaults). My guess is that it's not important (since we are unlikely to want to customise widget appearance using X in a gnustep app), but if we wanted to support it then it would ideally be done differently for every X window, using a hierarchy to identify the app and the widget within the app (eg a particular button within a particular panel within a particular app), possibly using some extension to the theming API. I would vote for ignoring it as an unused feature that nobody appears to want/need.

…the App name from NSProcessInfo, that way certaain windowmanagers (e.g. Xfce) can group windows per application, and not lump all GS apps together
user-friendly than full bundle identifier alternative.
@rmottola
Copy link
Member Author

@rfm I cleaned up and use the process name, as suggested. The Bundle Identifier was too verbose and unexpected in most cases, except certain GNOME applications, but we like to be more user friendly. I hope the C handling of string and memory is correct? No Copy needed! I copied it from the root window.

Copy link
Member

@fredkiefer fredkiefer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we need the type cast.

@fredkiefer fredkiefer merged commit 3665c40 into master Dec 23, 2025
1 of 4 checks passed
@rmottola
Copy link
Member Author

Not sure if we need the type cast.

we do because UTF8String retunrs a const char* and it needs a cast to char* or we get a warning. I worked though for me.

@rmottola rmottola deleted the win_groups branch December 23, 2025 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants