flathub / org.chromium.Chromium

https://flathub.org/apps/details/org.chromium.Chromium
45 stars 25 forks source link

Installed webapps don't associate with their launcher on Wayland Ozone platform #216

Open wjt opened 2 years ago

wjt commented 2 years ago

I learned that since Chromium 100, there is a "Preferred Ozone platform" setting in chrome://flags. If you set it to "Auto" (the default is "Default") then Wayland is used if available. It works quite nicely but something is awry with installed web apps.

  1. Browse to https://www.nytimes.com/games/wordle/
  2. Hit ⋮ → More tools → Create shortcut…
  3. In the “Create shortcut?” dialog, tick “☑ Open as window” and press OK
  4. Close the resulting window
  5. From GNOME's app grid, launch Wordle
  6. Hold Alt and press Tab, or check the running apps on the dash

With non-Flatpak:ed Google Chrome, Wordle appears with its own app icon in Alt+Tab and the dash. With Flatpak:ed Chromium, it is grouped together with my other Chromium windows.

wjt commented 2 years ago

Please forgive this being in screenshot form but I can't copy-paste from GNOME Shell's lg console.

Capture d’écran de 2022-03-31 15-37-12

r(4) is the Wordle window when Chromium is set to be a Wayland app. r(8) is the Wordle window when Chromium is set to be an X11 app.

wjt commented 2 years ago

IIRC Mutter or Shell has some crazy heuristics for Chromium's WMClass in particular

refi64 commented 2 years ago

This might be an upstream bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1164782#c6

christianfosli commented 2 years ago

This might be an upstream bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1164782#c6

I wrote that comment, it was running flatpak chromium though. I never tried non-flatpaked chromium as I assumed the results would be the same.

zocker-160 commented 2 years ago

I have this same issue on Kubuntu on X11. It only happens when using the Chromium Flatpak.

Interestingly enough this problem does not happen with the Google Chrome Flatpak, where they fixed it some time ago see: https://github.com/flathub/com.google.Chrome/issues/39

teohhanhui commented 2 years ago

fwiw I'm using com.google.Chrome and am facing the same issue when running with --gtk-version=4 --ozone-platform-hint=auto (on Wayland). When running under XWayland it's fine.

adombeck commented 1 year ago

Same issue here when running Chromium or Chrome on Wayland via Flatpak. No issue when running Chromium without Flatpak.

sepehr commented 1 year ago

Experiencing same as @adombeck.

ljrk0 commented 1 year ago

Having the same issue and solved it by editing the .desktop file similar as described here: https://forum.manjaro.org/t/web-apps-no-longer-have-an-icon/104534

For any application with hash $hash which opens to website https://$domain/$path on launch, the .desktop's Exec and StartupWMClass fields should look like:

Exec=flatpak 'run' '--command=/app/bin/chromium' 'org.chromium.Chromium' '--profile-directory=Default' '--app-id=$hash' '--app=$url'
StartupWMClass=chrome-$domain__$xpath-Default

where $xpath is the $path with all slashes / replaced by underscores _.

chsjr1996 commented 1 year ago

Following the example of @ljrk0 I made this modification:

Before

StartupWMClass=crx_bdemgigmjhobefogpblhomeihekoaajf

After

StartupWMClass=chrome-bdemgigmjhobefogpblhomeihekoaajf-Profile_1

The changes includes replace crx_ to chrome- at the beginning and append the current Profile ID, in my case -Profile_1 (but this can be -Default in another Chromium profile).

KibSquib48 commented 11 months ago

Sorry to bump but has there been any progress made on this anywhere?

Malix-Labs commented 5 months ago

Bump again

benyaminl commented 2 months ago

@KibSquib48 and @Malix-Labs you need to edit .desktop based on @chsjr1996 change