Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
iBelieve opened this issue Aug 2, 2016 · 6 comments
Open

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

iBelieve opened this issue Aug 2, 2016 · 6 comments
Labels
bug Something isn't working upstream Upstream issue

Comments

@iBelieve
Copy link
Member

iBelieve commented Aug 2, 2016

selection_002

@iBelieve iBelieve added the bug Something isn't working label Aug 2, 2016
@plfiorini
Copy link
Member

What does the .desktop say for the Icon field?

@plfiorini plfiorini added this to the M2 milestone Aug 3, 2016
@iBelieve
Copy link
Member Author

iBelieve commented Aug 3, 2016

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 iBelieve self-assigned this Aug 23, 2016
@plfiorini
Copy link
Member

@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 plfiorini added the upstream Upstream issue label Aug 23, 2016
@iBelieve
Copy link
Member Author

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 iBelieve removed their assignment Aug 23, 2016
@iBelieve
Copy link
Member Author

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

@plfiorini
Copy link
Member

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 plfiorini removed this from the M2 milestone Aug 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream Upstream issue
Projects
None yet
Development

No branches or pull requests

2 participants