Hi John, hi Eirik, looking at the properties of the X window I don't see why the quality gets better after the change:
Running xprop on the netbeans window gives me _NET_WM_ICON sizes: 16x16 32x32 48x48 128x128 a quick search in the JDK source gives this (on Unix): JFrame#setIconImages calls XWindowPeer#updateIconImages calls XWindowPeer#normalizeIconImages https://github.com/openjdk/jdk/blob/0aafa24d023702f2423a4520c452450d079ef49a/src/java.desktop/unix/classes/sun/awt/X11/XWindowPeer.java#L356 I read this as: Icon sizes 16, 32, 48 are added to the icon list. The 256 is processed. This gets scaled to half its size (128) and that is the last icon added. This is matched by the logging: FINEST [sun.awt.X11.icon.XWindowPeer]: >>> Length_ of buffer of icons data: 19976, maximum length: 65535 FINEST [sun.awt.X11.icon.XWindowPeer]: >>> Sizes of icon images: FINEST [sun.awt.X11.icon.XWindowPeer]: IconInfo[w=16,h=16,sw=16,sh=16] FINEST [sun.awt.X11.icon.XWindowPeer]: IconInfo[w=32,h=32,sw=32,sh=32] FINEST [sun.awt.X11.icon.XWindowPeer]: IconInfo[w=48,h=48,sw=48,sh=48] FINEST [sun.awt.X11.icon.XWindowPeer]: IconInfo[w=256,h=256,sw=128,sh=128] 512px icons will exceed the buffer in any case. So the best we can currently get on X11 is 128px Icons (scaled down from 256px). John, I think you are seeing a Plasma bug. If plasma does not use the highest resultion icon, that is available, it is broken. The specification for _NET_WM_ICON: https://specifications.freedesktop.org/wm-spec/1.3/ar01s05.html describes, that the icon size can be trivially determined. If a WM depends on the order of the icons and does to traverse the whole list, I would call it buggy. There is no defined order. Greetings Matthias Am Dienstag, den 14.01.2020, 14:29 +0000 schrieb Eirik Bakke: > Hi, John. Welcome! > > That would be a useful patch. As you say, the challenge is to make > sure it does not break the icon on other platforms. > > Since calling setIconImages with more variants should normally be the > right thing to do, removing the lower-resolution images should only > be done on the specific platform where this is required. Instead of > commenting out the lines, I would put them in an "if" statement, and > only exclude them if the system is running on the KDE Plasma desktop. > Perhaps you could also try another window manager (in particular, > whichever one is used by Ubuntu, which is pretty popular), and see if > that one requires the patch as well. > > If all the common Linux window managers require (or work with) the > patch, then maybe the condition should be " Utilities.isUnix() && > !Utilities.isMac()" (using org.openide.util.Utilities). But if it's > only the KDE Plasma desktop, then it might be worth seeing if there > is an way to detect this specific case. > > -- Eirik > > -----Original Message----- > From: John Elliot V | ProgClub <[email protected]> > Sent: Wednesday, January 8, 2020 10:09 PM > To: [email protected] > Subject: NetBeans icon patch > > Hi there. > > My name's John. I'm new. :) > > I just wanted to tender a patch for an issue I've been having with > the NetBeans icon when displayed on my KDE Plasma desktop running > under Ubuntu 18.04.3 LTS. > > The problem is that I have my Task Manager widget set at about 200px > high. There's no problem when I have heaps of windows open, because > in that case each application gets an icon on a 'row'; but when > there's only one 'row' the application icons are huge, and when the > application icons are huge the NetBeans icon looks terrible. > > I've taken some screen shots to illustrate the problem and my > solution over here: > > https://www.jj5.net/file/2020-01-09-135528/netbeans-icon/ > > The patch that works well enough for me is to comment out low > resolution images from the initFrameIcons() method in: > > platform/core.windows/src/org/netbeans/core/windows/view/ui/MainWindo > w.java > > as: > > static void initFrameIcons(Frame f) { > List currentIcons = f.getIconImages(); > if( !currentIcons.isEmpty() ) > return; //do not override icons if they have been already > provided elsewhere (JDev) > f.setIconImages(Arrays.asList( > // 2020-01-09 jj5 - OLD: removed low resolution icons... > //ImageUtilities.loadImage(ICON_16, true), > //ImageUtilities.loadImage(ICON_32, true), > //ImageUtilities.loadImage(ICON_48, true), > // 2020-01-09 jj5 - END > ImageUtilities.loadImage(ICON_256, true), > ImageUtilities.loadImage(ICON_512, true), > ImageUtilities.loadImage(ICON_1024, true))); } > > It is conceivable this patch will create an issue in other > environments (I'm not sure) but it worked okay for me on Ubuntu. > > Regards, > John Elliot V > -- > > _|O|_| ProgClub > > _|_|O| Because every programmer needs a good club! > > O|O|O| https://www.progclub.org/ > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > For further information about the NetBeans mailing lists, visit: > https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
