shell icon indicating copy to clipboard operation
shell copied to clipboard

Chrome apps don't have the correct icons in the launcher

Open iBelieve opened this issue 9 years ago • 6 comments

selection_002

iBelieve avatar Aug 02 '16 23:08 iBelieve

What does the .desktop say for the Icon field?

plfiorini avatar Aug 03 '16 05:08 plfiorini

Here's the .desktop file for Chrome Remote Desktop:

#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Terminal=false
Type=Application
Name=Chrome Remote Desktop
Exec=/opt/google/chrome/google-chrome --profile-directory=Default --app-id=gbchcmhmhahfdphkhkmpfmihenigjmpp
Icon=chrome-gbchcmhmhahfdphkhkmpfmihenigjmpp-Default
StartupWMClass=crx_gbchcmhmhahfdphkhkmpfmihenigjmpp

The icons come from ~/.local/share/icons/hicolor:

/home/mspencer/.local/share/icons/
└── hicolor
    ├── 128x128
    │   └── apps
    │       ├── chrome-aohghmighlieiainnegkcijnfilokake-Default.png
    │       └── chrome-pnoffddplpippgcfjdhbmhkofpnaalpg-Default.png
    ├── 16x16
    │   └── apps
    │       ├── chrome-aohghmighlieiainnegkcijnfilokake-Default.png
    │       └── chrome-pnoffddplpippgcfjdhbmhkofpnaalpg-Default.png
    ├── 256x256
    │   └── apps
    │       ├── chrome-bgjohebimpjdhhocbknplfelpmdhifhd-Default.png
    │       └── chrome-pnoffddplpippgcfjdhbmhkofpnaalpg-Default.png
    ├── 32x32
    │   └── apps
    │       ├── chrome-hlffpaajmfllggclnjppbblobdhokjhe-Default.png
    │       └── chrome-pnoffddplpippgcfjdhbmhkofpnaalpg-Default.png
    ├── 48x48
    │   └── apps
    │       ├── chrome-gbchcmhmhahfdphkhkmpfmihenigjmpp-Default.png
    │       └── chrome-pnoffddplpippgcfjdhbmhkofpnaalpg-Default.png
    └── 512x512
        └── apps
            └── chrome-pnoffddplpippgcfjdhbmhkofpnaalpg-Default.png

iBelieve avatar Aug 03 '16 13:08 iBelieve

@iBeliever It depends on the theme, I logged the requested icon and the resulting QIcon from the Fluid icon theme image provider with Papirus GTK:

Requested "chrome-dlhghfjpjbjckmefnkkmgechilbmhflf-Default" QIcon("chrome",availableSizes[normal,Off]=(QSize(16, 16), QSize(22, 22), QSize(24, 24), QSize(48, 48), QSize(32, 32)),cacheKey=0

Somehow Papirus GTK provides an icon for Chrome apps. There are icons like chrome.svg and chrome-okdgofnjkaimfebepijgaoimfphblkpd.svg though I don't know how this should affect the lookup exactly.

If I use Adwaita I can see the icon correctly and the log reports:

Requested "chrome-dlhghfjpjbjckmefnkkmgechilbmhflf-Default" QIcon("chrome-dlhghfjpjbjckmefnkkmgechilbmhflf-Default",availableSizes[normal,Off]=(QSize(48, 48), QSize(32, 32), QSize(256, 256), QSize(16, 16), QSize(128, 128), QSize(48, 48), QSize(32, 32), QSize(256, 256), QSize(16, 16), QSize(128, 128)),cacheKey=0x3400000000)

My Chrome application is this page and as you can see here it shows the GH icon:

icon

It might also be a Qt bug but I'm not sure what should I report since it works with Adwaita.

plfiorini avatar Aug 23 '16 21:08 plfiorini

Yeah, it looks like somehow Paper is falling back to a generic Chrome icon instead of the original icons when a Paper version of the icon isn't found. I think the original issue was that I didn't have the Hawaii icon theme installed (I've since changed the theme in dconf).

iBelieve avatar Aug 23 '16 21:08 iBelieve

Though, that only happens in qmlOS - they properly fall back to the original icons in GNOME.

iBelieve avatar Aug 23 '16 21:08 iBelieve

QIcon might have some issue with hicolor.

This is a simple program:

#include <QtWidgets/QApplication>
#include <QtGui/QIcon>
#include <QDebug>

int main(int argc, char *argv[])
{
        QApplication app(argc, argv);
        qWarning() << QIcon::themeName();
        //QIcon::setThemeName("hicolor");
        qWarning() << QIcon::themeName();
        qWarning() << QIcon::fromTheme("rhythmbox");
        qWarning() << QIcon::fromTheme("chrome-dlhghfjpjbjckmefnkkmgechilbmhflf-Default");
        return app.exec();
}

Set XDG_DATA_DIRS=$HOME/.local/share:/usr/share, build and run.

This is the output:

"Papirus-GTK"
"Papirus-GTK"
QIcon("rhythmbox",availableSizes[normal,Off]=(QSize(16, 16), QSize(22, 22), QSize(24, 24), QSize(32, 32), QSize(48, 48)),cacheKey=0x100000000)
QIcon("chrome",availableSizes[normal,Off]=(QSize(16, 16), QSize(22, 22), QSize(24, 24), QSize(32, 32), QSize(48, 48)),cacheKey=0x200000000)

Uncomment the line that sets the theme to hicolor, build and run:

"Papirus-GTK"
"hicolor"
QIcon("rhythmbox",availableSizes[normal,Off]=(QSize(48, 48), QSize(32, 32), QSize(256, 256), QSize(24, 24), QSize(22, 22), QSize(16, 16)),cacheKey=0x100000000)
QIcon("chrome-dlhghfjpjbjckmefnkkmgechilbmhflf-Default",availableSizes[normal,Off]=(QSize(48, 48), QSize(32, 32), QSize(256, 256), QSize(16, 16), QSize(128, 128)),cacheKey=0x200000000)

plfiorini avatar Aug 29 '16 16:08 plfiorini