apache / netbeans

Apache NetBeans
https://netbeans.apache.org/
Apache License 2.0
2.69k stars 853 forks source link

NetBeans uses the wrong icon on linux since NB 22 #7734

Open mbien opened 2 months ago

mbien commented 2 months ago

Apache NetBeans version

Apache NetBeans 22

What happened

I noticed that my quicklaunch shortcut on linux was actually using the .icns file since there was no other vector graphics file it could use (I can't select the png), it looks now like:

image

expected:

image

There is also the risk that linux distributions will start using the mac icon at some point since most migrated away from .pngs by now and there is no svg in ./nb

installing NB on fedora from their Flathub repo does also use the MacOS icon which seems to confirm my suspicion above: image

refs: https://github.com/apache/netbeans-nbpackage/pull/51 https://github.com/apache/netbeans/pull/7127 https://github.com/apache/netbeans/pull/7132

Language / Project Type / NetBeans Component

No response

How to reproduce

install NB on linux and check which icon is registered, the icon on top of the white rounded rectangle is meant for mac.

Did this work correctly in an earlier version?

No / Don't know

Operating System

linux, gnome

JDK

21

Apache NetBeans packaging

Apache NetBeans provided installer

Anything else

No response

Are you willing to submit a pull request?

No

eirikbakke commented 2 months ago

I think it would be OK to use a 256x256 png file here instead of the harder-to-generate ICNS format, or the SVG format which can look different based on which library is used to render it. That's what I ended up doing for Linux for my own app, after testing each option on Ubuntu.

In my own icon's case the rendering of shadows looked weird when the SVG version was used, though my app has a more complicated logo.

mhalachev commented 2 months ago

I also agree, either a PNG or the SVG. Perhaps the SVG icon should work well with different renderers in this particular case as it is composed of single colour polygons, no shadows, halftones or complex curves.

mbien commented 2 months ago

we could probably also do both. png and svg. Potentially also designate the mac specific icon as a variant of the actual logo.

e.g: netbeans.png, netbeans.svg and netbeans2.icns

neilcsmith-net commented 2 months ago

The SVG from NBPackage should be a good option to bring in as it's been quite widely tested, and in use for the ASF and community RPM and DEB packages. As yet I don't think we've had a report of it not displaying anywhere?

If added, it will need a RAT exclusion. Do not try and add the Apache license - for some reason this will cause it to fail to display in certain areas of certain versions of GNOME. :shrug:

We should probably also add a 48x48 PNG, amongst other resolutions. That is meant to be the baseline requirement in the icon spec - https://specifications.freedesktop.org/icon-theme-spec/latest/#install_icons The RPM and DEB packages include a 48x48 PNG and an SVG at /usr/share/icons/hicolor/48x48/apps/apache-netbeans.png and /usr/share/icons/hicolor/scalable/apps/apache-netbeans.svg respectively.

The .desktop file just contains Icon=apache-netbeans.

That strategy should probably be used elsewhere, but with the two icons in a suitable location - Snap / Flatpak paths, or user local share icons.

matthiasblaesing commented 2 months ago

Am I missing something obvious? Isn't the solution trivial? Restore the original icns File, rename the current one to "netbeans-macos.icns" and adjust the references?

neilcsmith-net commented 2 months ago

Personally I don't see why the Apple Icon Image file should support anything other than macOS? It's not even preferred there any more. Despite what is implied in the issue report, it's not a vector image either. Let's provide actually useful formats for other OS (higher resolution .png, .svg and .ico).

The flatpak package is not using this icon because they want an .icns file either - they want .png - https://github.com/flathub/org.apache.netbeans/blob/master/org.apache.netbeans.yaml#L40

matthiasblaesing commented 2 months ago

Personally I don't see why the Apple Icon Image file should support anything other than macOS?

I don't see why it should not. Before someone decided to mutilate the .icns file, my gnome shell setup showed a nice high resolution version of the NetBeans Logo. A quick google search dated support for .icns in gdk back to 2007. So it is not as absurd as you make it. I also did not imply that the .icns contains vectors.

neilcsmith-net commented 2 months ago

I don't see why it should not. Before someone decided to mutilate the .icns file, my gnome shell setup showed a nice high resolution version of the NetBeans Logo. A quick google search dated support for .icns in gdk back to 2007.

Sure, but it is not part of the XDG spec. Use https://github.com/apache/netbeans-nbpackage/blob/master/src/main/resources/org/apache/netbeans/nbpackage/apache-netbeans.svg and you'll still get a nice high resolution in GNOME just fine.

EDIT : How were you configuring GNOME to pick up the .icns file in the first place??

matthiasblaesing commented 2 months ago

I don't see why it should not. Before someone decided to mutilate the .icns file, my gnome shell setup showed a nice high resolution version of the NetBeans Logo. A quick google search dated support for .icns in gdk back to 2007.

Sure, but it is not part of the XDG spec. Use https://github.com/apache/netbeans-nbpackage/blob/master/src/main/resources/org/apache/netbeans/nbpackage/apache-netbeans.svg and you'll still get a nice high resolution in GNOME just fine.

I use the zip distribution and that has now either the mutilated NetBeans icon in nb/netbeans.icns or a low res version in nb/netbeans.png. So now I can choose the nicely looking, but wrong mac-os icon or the png version, that looks like it comes straight from 2000 or earlier.

EDIT : How were you configuring GNOME to pick up the .icns file in the first place??

I use alacarte to create a new menu entry, add a new entry in "Development", choose "NetBeans" as name, enter the path to the netbeans script into the "Command" line, click on the icon button, go to the netbeans/nb folder from the zip and choose the netbeans.icns file. Done.

neilcsmith-net commented 2 months ago

It was not mutilated, it was brought into line with the design guidelines for its defined purpose on macOS (dock icon in the launcher).

Download the SVG and choose that for your icon for now, and let's get that SVG and higher resolution PNGs in before NB24.

In fact the PNG are already in https://github.com/apache/netbeans/tree/master/platform/core.startup/src/org/netbeans/core/startup they just need copying and renaming to https://github.com/apache/netbeans/tree/master/nb/ide.branding/release I was using those from the source tree when I was manually crafting .desktop files for personal use (never looked at alacarte)

mbien commented 2 months ago

EDIT : How were you configuring GNOME to pick up the .icns file in the first place??

let me go back to the actual problem of this situation: if the zip doesn't have a vector graphics icon but just the mac variant, downstream distributions will start using the wrong icon. This was first just a concern I voiced under the PR which changed it but got confirmed by flatpak on fedora (which is the only way to install NB "out of the box" there), which started using the wrong icon - screenshot provided in the issue.

So all those questions don't actually matter. NB needs the NB vector graphics logo in the zip to make it for everyone obvious what the logo is - I have no problem with variants of it if someone is willing to maintain those variants but it obviously also needs the original. (PNG is a nice-to-have, why not)

OS themes itself do also bundle application icons, so far they still use the right icons:

find . -iname "*netbeans*"
./Vibrancy-Colors/apps/16/netbeans.png
./Vibrancy-Colors/apps/16/netbeans-beta.png
./Vibrancy-Colors/apps/96/netbeans.png
./Vibrancy-Colors/apps/96/netbeans-beta.png
./Vibrancy-Colors/apps/48/netbeans.png
./Vibrancy-Colors/apps/48/netbeans-beta.png
./Vibrancy-Colors/apps/22/netbeans.png
./Vibrancy-Colors/apps/22/netbeans-beta.png
./Vibrancy-Colors/apps/64/netbeans.png
./Vibrancy-Colors/apps/64/netbeans-beta.png
./Vibrancy-Colors/apps/32/netbeans.png
./Vibrancy-Colors/apps/32/netbeans-beta.png
./Vibrancy-Colors/apps/24/netbeans.png
./Vibrancy-Colors/apps/24/netbeans-beta.png
./Vibrancy-Colors/apps/256/netbeans.png
./Vibrancy-Colors/apps/256/netbeans-beta.png
./Papirus/48x48/apps/netbeans-beta.svg
./Papirus/48x48/apps/org.apache.netbeans.svg
./Papirus/48x48/apps/netbeans.svg
./Papirus/22x22/apps/netbeans-beta.svg
./Papirus/22x22/apps/org.apache.netbeans.svg
./Papirus/22x22/apps/netbeans.svg
./Papirus/24x24/apps/netbeans-beta.svg
./Papirus/24x24/apps/org.apache.netbeans.svg
./Papirus/24x24/apps/netbeans.svg
./Papirus/16x16/apps/netbeans-beta.svg
./Papirus/16x16/apps/org.apache.netbeans.svg
./Papirus/16x16/apps/netbeans.svg
./Papirus/32x32/apps/netbeans-beta.svg
./Papirus/32x32/apps/org.apache.netbeans.svg
./Papirus/32x32/apps/netbeans.svg
./Papirus/64x64/apps/netbeans-beta.svg
./Papirus/64x64/apps/org.apache.netbeans.svg
./Papirus/64x64/apps/netbeans.svg

we are lucky here: the svg is still the right/current icon, the png is the old NB 5 icon (I assume the theme itself is vintage). netbeans

neilcsmith-net commented 2 months ago

@mbien 100% agree, and this also duplicates #4881 Let's fix that in NB24. What I object to is changing the semantics of the existing .icns file, which is in there to be used in the launcher to provide the macOS dock icon.

EDIT : the question was relevant in the sense that I wanted to know whether the wrong icon was being picked up in any other way than people explicitly choosing the wrong icon file! 😄