linuxmint / cinnamon

A Linux desktop featuring a traditional layout, built from modern technology and introducing brand new innovative features.
GNU General Public License v2.0
4.56k stars 743 forks source link

Chrome Web Apps don't show the app icon in the panel. #6084

Open rics opened 7 years ago

rics commented 7 years ago

The Web Apps from Chrome dont show their respective icon in the panel. They all show the same default chrome icon, as you can see in the images attached. screenshot systeminfo

JosephMcc commented 7 years ago

I just tried this with Sheets and Weatherbug and both worked fine on 3.2.

JosephMcc commented 7 years ago

https://github.com/linuxmint/Cinnamon/issues/4730

JosephMcc commented 7 years ago

I'd like to get confirmation from someone else as to weather or not this works for them. As I said, it works fine here on 18/Cinnamon master.

rics commented 7 years ago

I found out that if you create the webapp shortcut it works perfectly, but the webapps you already have in your google account before installing Chrome don't work.

What I have to do if I want webapp icon showing in panel is to remove existing webapps and than adding all again.

:(

germanfr commented 7 years ago

@JosephMcc I've just downloaded Google Docs and it shows the Chromium icon, not its own. I'm on 3.2.1.

SerafDosSantos commented 7 years ago

I'm on Mint 18.1 and they do show the app icons. It didn't show for me prior to 18.1. Cheers!

rics commented 7 years ago

I'm in Mint 18.1 too. It only shows the app icons if I create the shortcut already in Mint. The apps I had previous in Chrome show the Chrome icon.

I than delete all my webapps shortcuts and created it all again. It works now, but is frustrating anyway.

timmie commented 7 years ago

The menu also does not show Epiphany webapps. Is this a separate bug?

focusaurus commented 5 years ago

I still have this problem in Linux Mint 19.1 but not consistently. Here's a screenshot of google calendar having the correct icon but gmail having the generic chrome icon. I compared the corresponding manifest.json files and could find nothing of notable difference that might explain the icon.

screenshot from 2018-12-21 08-16-57-chrome-icons

Vahan86 commented 4 years ago

@rics, is this still an issue in Cinnamon 4.4?

rics commented 4 years ago

@rics, is this still an issue in Cinnamon 4.4?

Can't tell... Not using it anymore...

ghost commented 3 years ago

Still an issue on Cinnamon 4.6.7

mtwebster commented 3 years ago

I can reproduce this.

If I open the desktop file chrome created (in ~/.local/share/applications - prefixed with chrome-), I have:

#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Terminal=false
Type=Application
Name=Entanglement Web App
Exec=/usr/lib/chromium/chromium --profile-directory=Default --app-id=aciahcmjmecflokailenpkdchphgkefd
Icon=chrome-aciahcmjmecflokailenpkdchphgkefd-Default
StartupWMClass=crx_aciahcmjmecflokailenpkdchphgkefd

The StartupWMClass is used to tell Cinnamon (or any desktop) to expect a window with that wm class - this allows the window to be identified easily (especially when the .desktop file name has no relation to the program it's running).

The problem is that the Exec line is never telling chromium to use that wm class (run xprop and click on a window to see this sort of info, like wm class).

If I modify the Exec line to:

Exec=/usr/lib/chromium/chromium --profile-directory=Default --app-id=aciahcmjmecflokailenpkdchphgkefd --class=crx_aciahcmjmecflokailenpkdchphgkefd

then when we try to launch the app again, the icon is now correct, because Cinnamon is able to match the class with the desktop file's StartupWMClass (again, you can run xprop and click the chromium window to see the class being set).

There's another problem, though: If you launch your app, and then later launch a normal chrome browser window, it will also end up with that app's icon. I haven't figured out a way around this yet - even if I create a new profile and make the app shortcut using it, chromium doesn't appear willing to launch a separate process for that profile, so the icon issue remains.

tldr; This is a mess, mostly with chromium, and can only be partially fixed by manually editing the generated desktop files.

ghost commented 3 years ago

In my case, it's not a chrome web app, but an extension (still a web app, but .desktop files are not involved.)

mtwebster commented 3 years ago

That's probably even more useless (no desktop file to match).

I've got an idea I'm trying out, it may let us at least get the correct icon for a window.

mtwebster commented 3 years ago

I was able to fix chrome showing the correct icon for extensions that create windows (like LINE): https://github.com/linuxmint/cinnamon/commit/2b269f9c460b8079d9eb5d1ed989d9c276e60128.

The drawback is that the icon will not be a hi-res icon you typically get on the panel. Since these windows lack any associated .desktop file, they can't specify an icon name. Instead, they attach a limited set of the icon images themselves that we can get from the window. Still, it's better than using the browser icon.

This may assist in other situations I haven't envisioned.

Chromium doesn't construct valid desktop files for its web apps (the ones you can add shortcuts from chrome://apps) - and even then it doesn't respect its own command line switches. This trouble is shared with chromium-based browsers. Using a unique profile (as opposed to using the user's default) improves the experience somewhat (this is an option in our new WebApp Manager, I'm not sure about other utilities that create these).

I've been looking into the chromium source and may try to address or at least raise discussion there about these issues but I don't have time at the moment.

ghost commented 3 years ago

Good enough, tbh. On small taskbar sizes you barely notice the difference in image quality anyway.

(Was on Xfce there for a while, back on Cinnamon now.)

I've noticed it using the Chromium icon the first time still, but every time afterwards it seems to be using the correct icon.

ghost commented 3 years ago

Okay, here's how it goes. When I load it up, it uses default Chromium icon no matter what. I have to restart Cinnamon while the app is running, and then the icon gets replaced with the correct one.

igorsantos07 commented 3 weeks ago

Sorry for the mostly +1 comment, but I'd like to specifically second a scenario reported in 2020 during the investigations: when you create two different Web Apps, the second one you open will have the same icon as the first one.

Also, Vivaldi simply won't show the specific icon, be it created from the Web Apps utility, or from oldskool launchers like the old ones I still have around: /usr/bin/vivaldi --profile-directory=Default --app=https://mail.google.com/mail/u/1/.

I should mention this was never an issue with Chrome when I used the Mate desktop (I don't recall Vivaldi's state, though). So maybe there's a way around if you look how Mate solves that?