Skip to content

Fix Chromium web app grouping in Cinnamon with manual StartupWMClass detection#395

Open
sohailb108 wants to merge 1 commit intolinuxmint:masterfrom
sohailb108:startupwmclass-detect-button
Open

Fix Chromium web app grouping in Cinnamon with manual StartupWMClass detection#395
sohailb108 wants to merge 1 commit intolinuxmint:masterfrom
sohailb108:startupwmclass-detect-button

Conversation

@sohailb108
Copy link
Copy Markdown

In Cinnamon, different Chromium web apps can get the icon of the first one launched and group together.

I found that StartupWMClass in the .desktop file didn't match the window class from xprop WM_CLASS and updating StartupWMClass to match fixed the issue.

Since Chromium sets the window class at runtime, correct automatic detection at add time sounds impossible.
So this PR adds a manual fix in Web Apps with a new toolbar button.

How to use it:

  • Select a Chromium-based web app from the list.
  • Click the newly added button (rightmost one) to launch it and start detection.
  • The cursor changes to a cross.
  • Click the launched app window.
  • xprop WM_CLASS is read, and the first WM_CLASS value is saved into StartupWMClass in the corresponding .desktop file.

How to test:

  • Create two different Chromium web apps.
  • Launch both and confirm they are grouped together with the same icon in the panel.
  • Apply the fix for each app using the new button.
  • Launch both again and confirm each one appears separately with the correct icon.
  • You can also open the .desktop file and verify that StartupWMClass was updated to the WM_CLASS value returned by xprop.

Changes:

  • Added a new toolbar button (rightmost) to the Web App management window.
  • Implemented the detection and update routine.

Fixes #100

@ArqamQazi
Copy link
Copy Markdown

ArqamQazi commented Apr 30, 2026

If you are changing the StartupWMClass to the URL, why not set it that way in the first place?
I think we should set the StartupWMClass to be the url for chromium browser.

@sohailb108
Copy link
Copy Markdown
Author

sohailb108 commented Apr 30, 2026

If you are changing the StartupWMClass to the URL, why not set it that way in the first place? I think we should set the StartupWMClass to be the url for chromium browser.

That is not exactly the URL. Chromium sometimes add something to it.
As I've mentioned, it is hard to predict.

@ArqamQazi
Copy link
Copy Markdown

ArqamQazi commented May 1, 2026

This PR seems to solve that problem, it is for wayland, but you can change the is_Wayland to always return true.
Changing the StartupWMClass from start seems to be the solution.
That PR should also solve your problem, can you test it?

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.

All apps are being assigned the same icon in Cinnamon panel+6

2 participants