LongDirtyAnimAlf / fpcupdeluxe

A GUI based installer for FPC and Lazarus
504 stars 94 forks source link

Windows-Icons in Linux #499

Closed sesvena closed 1 year ago

sesvena commented 2 years ago

fpcupdeluxe uses the file lazarus.ico as desktop icon under Linux. Especially compressed icons are mostly not supported by Linux. There is a corresponding bug report (https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/39596). Under Linux for Icon's usually the PNG format is used. Corresponding icons are available in the folder /images/icons/. I could find a place in the sourcecode where the lazarus.ico is used and included a patch for it. fpcuputil.pas.patch.zip

LongDirtyAnimAlf commented 2 years ago

This seems to be fixed by Lazarus itself. Is this issue still present with the recent releases of Lazarus ?

sesvena commented 2 years ago

Actually, this is not a problem of fpcupdeluxe or Lazarus, but of Linux.

A Windows icon consists of several single images in different sizes, which can also be compressed. Depending on the purpose, Windows extracts and displays the appropriate size. The order of the single images within the .ico file does not matter.

Linux will only display the first uncompressed frame. can only display the icon if the largest frame is the first in the sequence. Linux cannot display compressed frames. If the first frame contained in the .ico file has a size of 16x16 pixels, Linux scales it to 48x48 pixels for display on the desktop. Of course, this looks very unsatisfactory. In the concrete case I have changed the order of the single images, within the Lazarus icon (the largest icon is now the first). So under Linux now the 48x48 single image is used, all other partial images are disregarded.

So the problem is solved for the time being.

But finally the question remains, should one use Windows icons under Linux? - or better use the PNG format provided for this purpose?

LongDirtyAnimAlf commented 2 years ago

The Lazarus bug-report regarding this has been closed as solved. So, the question remains: should fpcupdeluxe use the png icon ? Or keep things as default by following Lazarus itself ?

sesvena commented 2 years ago

In my opinion lazarus.ico should be used on Windows, lazarus256x256.png on Linux and lazarus.icns on macOS. Lazarus provides the appropriate icons in the Lazarus\images\icons folder.

By adapting the Windows icon, we were able to solve most of the problem under Linux. Since I don't have macOS, I can't say if this solution works there as well.

So if it's too much work, I would close the bug report.

LongDirtyAnimAlf commented 1 year ago

Finally, I have added the proposed changes. Will be used for pre-releases to get feedback. https://github.com/LongDirtyAnimAlf/fpcupdeluxe/commit/f678b0302f52ba2ff4fa89bf3d06f3695ac704d6#diff-8a60566075289a05010812ea4228d6d169af3f108f635aff37c22ca664a738bd

LongDirtyAnimAlf commented 1 year ago

Implemented. https://github.com/LongDirtyAnimAlf/fpcupdeluxe/releases/tag/v2.2.0q Closing.