Question

I have a problem to show high quality icon in Alt-Tab in Linux. My development is using GTK2, and using gtk_window_set_icon() for a 128x128 png icon. And the environment is GNOME3.

However, when I alt-tab, the icon is blurred and pixelated.

I am not sure it is caused by GNOME3 freedesktop.org specification, or caused by GTK2. Please help.

Was it helpful?

Solution

You can install multiple versions of the icon, at different resolutions, and Gnome should pick the best one depending on the context. So for example on Fedora 15 the firefox package installs several icons:

/usr/share/icons/hicolor/16x16/apps/firefox.png
/usr/share/icons/hicolor/22x22/apps/firefox.png
/usr/share/icons/hicolor/24x24/apps/firefox.png
/usr/share/icons/hicolor/32x32/apps/firefox.png
/usr/share/icons/hicolor/48x48/apps/firefox.png
/usr/share/icons/hicolor/256x256/apps/firefox.png

You can even install a scalable icon, so if it wanted to (it currently doesn't), the firefox package could install:

/usr/share/icons/hicolor/scalable/apps/firefox.svg

Then in the desktop file for the application just give the name of the icon, for example:

Icon=firefox

and Gnome should work it all out and choose the best icon for each context where it is using it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top