Bug 469602 - Launched application uses low-resolution icon
Summary: Launched application uses low-resolution icon
Status: REOPENED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.6   Edit
Hardware: PC Mac OS X
: P3 minor with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-08 04:40 EDT by Alex Blewitt CLA
Modified: 2020-06-02 11:57 EDT (History)
11 users (show)

See Also:


Attachments
Screenshot showing app switcher and lower-res java icon (37.99 KB, image/png)
2015-06-08 04:40 EDT, Alex Blewitt CLA
no flags Details
screenshot showing still an issue (43.32 KB, image/png)
2016-03-25 10:59 EDT, Alex Blewitt CLA
no flags Details
Launch config file generated by 'new configuration' under 'eclipse application' (2.02 KB, application/octet-stream)
2016-03-25 11:06 EDT, Alex Blewitt CLA
no flags Details
Blurred icon in launched product (102.55 KB, image/png)
2020-06-02 09:20 EDT, Alex Blewitt CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Blewitt CLA 2015-06-08 04:40:48 EDT
Created attachment 254177 [details]
Screenshot showing app switcher and lower-res java icon

When running an Eclipse application via PDE, the launched process is called 'java' and has a lower-resolution icon than the main launched instance.
Comment 1 Sarika Sinha CLA 2015-06-09 03:00:16 EDT
Copying Tony for his comment.
Comment 2 Marc-André Laperle CLA 2015-06-12 16:07:10 EDT
I think you might be missing in the VM args:
-Xdock:icon=../Resources/Eclipse.icns
Are you using a target file by any chance? It probably doesn't have that in the VM args section. I tried that and it works. But I'm not sure if it affects other platforms in bad ways.
Comment 3 Alex Blewitt CLA 2016-03-25 10:59:00 EDT
Created attachment 260575 [details]
screenshot showing still an issue

This is still an issue on OSX for 4.6M5 on OSX 10.11
Comment 4 Alex Blewitt CLA 2016-03-25 11:04:05 EDT
The command line generated by PDE is:

There is a checkbox which has "Use the -XstartOnFirstThread" argument when launching with SWT" but this doesn't appear to be recorded by the launcher. Maybe it's being passed in some other way.

The VM arguments are being launched with:

VM Arguments:

jvm_args: -Declipse.pde.launch=true -Dfile.encoding=UTF-8 -Xbootclasspath/p:/Downloads/Eclipse-4.6M6.app/Contents/Eclipse/plugins/org.eclipse.jdt.debug_3.10.0.v20160311-0736/jdi.jar 

java_command: org.eclipse.equinox.launcher.Main -launcher /Downloads/Eclipse-4.6M6.app/Contents/Eclipse/Eclipse.app/Contents/MacOS/eclipse -name Eclipse -showsplash 600 -product org.eclipse.sdk.ide -data /private/tmp/performance/../runtime-New_configuration -configuration file:/private/tmp/performance/.metadata/.plugins/org.eclipse.pde.core/New_configuration/ -dev file:/private/tmp/performance/.metadata/.plugins/org.eclipse.pde.core/New_configuration/dev.properties -os macosx -ws cocoa -arch x86_64 -nl en_GB -consoleLog
java_class_path (initial): /Downloads/Eclipse-4.6M6.app/Contents/Eclipse/plugins/org.eclipse.equinox.launcher_1.3.200.v20151021-1308.jar
Launcher Type: SUN_STANDARD
Comment 5 Alex Blewitt CLA 2016-03-25 11:06:24 EDT
Created attachment 260576 [details]
Launch config file generated by 'new configuration' under 'eclipse application'

NB this was in an empty configuration as generated by a 'new configuration' from the Run -> Run Configurations menu
Comment 6 Alex Blewitt CLA 2016-03-25 14:53:32 EDT
So it looks like the icon is being set as a 48x48 icon, scaled up:

if (display.dockImage == null) {
  if (images != null && images.length > 1) {
    Image [] bestImages = new Image [images.length];
    System.arraycopy (images, 0, bestImages, 0, images.length);
    sort (bestImages);
    images = bestImages;
  }
  if (images != null && images.length > 0) {
    display.application.setApplicationIconImage (images [0].handle);
  } else {
    display.application.setApplicationIconImage (null);
  }
}

The problem is that the Product images come in 16x16, 32x32 and 48x48.

They come from:

eclipse16.png,eclipse32.png,eclipse48.png

in

org.eclipse.sdk

          <property name="windowImages" value="eclipse16.png,eclipse32.png,eclipse48.png"/> 


The solution is probably to put higher resolution ones in there. There are 64, 128, 256, 512 and 1024.
Comment 7 Eclipse Genie CLA 2016-03-25 15:10:47 EDT
New Gerrit change created: https://git.eclipse.org/r/69337
Comment 8 Alex Blewitt CLA 2016-03-25 15:15:54 EDT
The plugin.xml for the sdk is in platform/eclipse.platform.git/platform/org.eclipse.sdk/plugin.xml so I'm moving it to the Platform project - please reassign if necessary.
Comment 9 Alex Blewitt CLA 2016-03-25 19:22:59 EDT
Commentary from review which is best associated with the bug as well for future reference/visibility:

No, currently this has been tested on OSX only. I can try and test it on Windows at another time but I don't have access to a Linux GUI desktop to try that out.

The window icon setting is done per platform; the images are sorted in reverse order of size, and the largest one is set on OSX at least. If there's issues with individual platforms perhaps they could be handled in SWT on a per-OS platform, say, by filtering out sizes which are too big.

https://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/bundles/org.eclipse.swt/Eclipse%20SWT/cocoa/org/eclipse/swt/widgets/Decorations.java#n543

https://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/bundles/org.eclipse.swt/Eclipse%20SWT/win32/org/eclipse/swt/widgets/Decorations.java#n985

https://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/bundles/org.eclipse.swt/Eclipse%20SWT/gtk/org/eclipse/swt/widgets/Decorations.java#n172

To replicate on OSX:

* Create a new launch config in PDE for a new Eclipse Application that runs org.eclipse.sdk.ide (or use the attached launch config)
* Run the launch config to see a new Eclipse application launched
* Use Cmd+Tab to switch between applications and/or look at the Dock icon and compare the Eclipse version with the PDE launched version. The Eclipse version looks crisp and clear while PDE appears pixelated owing to the expansion. This probably looks worse on hi dpi displays.

PS The reason that this isn't visible (generally) for Eclipse.app launches is that the Eclipse program has an eclipse.ini entry for -Xdock:/path/to/Eclipse.icns, which basically sets the dock icon at launch (and the SWT code acts as a bypass if the application icon has already been set).
Comment 10 David Williams CLA 2016-03-25 19:31:16 EDT
(In reply to Alex Blewitt from comment #9)
> Commentary from review which is best associated with the bug as well for
> future reference/visibility:
> 
> No, currently this has been tested on OSX only. I can try and test it on
> Windows at another time but I don't have access to a Linux GUI desktop to
> try that out.
> 
> The window icon setting is done per platform; the images are sorted in
> reverse order of size, and the largest one is set on OSX at least. If
> there's issues with individual platforms perhaps they could be handled in
> SWT on a per-OS platform, say, by filtering out sizes which are too big.
> 
> https://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/bundles/org.
> eclipse.swt/Eclipse%20SWT/cocoa/org/eclipse/swt/widgets/Decorations.java#n543
> 
> https://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/bundles/org.
> eclipse.swt/Eclipse%20SWT/win32/org/eclipse/swt/widgets/Decorations.java#n985
> 
> https://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/bundles/org.
> eclipse.swt/Eclipse%20SWT/gtk/org/eclipse/swt/widgets/Decorations.java#n172
> 
> To replicate on OSX:
> 
> * Create a new launch config in PDE for a new Eclipse Application that runs
> org.eclipse.sdk.ide (or use the attached launch config)
> * Run the launch config to see a new Eclipse application launched
> * Use Cmd+Tab to switch between applications and/or look at the Dock icon
> and compare the Eclipse version with the PDE launched version. The Eclipse
> version looks crisp and clear while PDE appears pixelated owing to the
> expansion. This probably looks worse on hi dpi displays.
> 
> PS The reason that this isn't visible (generally) for Eclipse.app launches
> is that the Eclipse program has an eclipse.ini entry for
> -Xdock:/path/to/Eclipse.icns, which basically sets the dock icon at launch
> (and the SWT code acts as a bypass if the application icon has already been
> set).

Thanks for the reply (where I should have commented to begin with :/ 

But, for the Mac, isn't the "right way to provide images" in a *icns file? 

It seems you are asking for a special case to make things easier for a special case, but which interferes with the normal case of running Eclipse. (That is, benefits some doing something special, but hurts others normal use). Please clarify if I have misunderstood.
Comment 11 David Williams CLA 2016-03-25 19:46:33 EDT
Let's move to SWT for comment and/or consideration on a "better way to fix". 

SWT Team, 

This is sort of (indirectly) related to bug 435222 (about emblems on Linux). 

But in general, I think each platform has their own "specs" on what type of image to display in the platform specific constructs (like 'launchers', 'tiles', etc.) so IMHO the "windows images list" (which is not platform specific) is not a viable way to "provide images". 

Any comment? Insights?
Comment 12 Alex Blewitt CLA 2016-03-25 21:33:08 EDT
I think the right way to fix it is to change the value of the window images in the product, because they can be different for other versions. However this may expose other bugs in SWT that then need to be fixed; for example, the 'setImages' call should perhaps filter on an OS-by-OS level for the appropriate size (instead of just 'biggest' as it currently does).
Comment 13 Alex Blewitt CLA 2016-04-07 16:51:38 EDT
I have tested the suggested fix on Windows and it appears to work fine there as well. Furthermore as platforms evolve the ability to use larger icons are likely to be seen there as well, not just as a property file.

Regarding Mac specifically, the .icns file are used by .app files; but it's possible for any application to use SWT's icons to change the dock image (this is used by Mylyn to put on a progress bar and other such places).
Comment 14 Alex Blewitt CLA 2016-04-26 03:59:54 EDT
Since one of the themes of Neon is the HiDPI support, can we get an opinion of whether setting images with a pixel size of > 48 for the product images is a good idea? I'm sure that other operating systems will benefit from this as well, not just OSX.

Essentially we have the updated .product file, but David wants to check with the SWT team that setting a large image on the window images makes sense.
Comment 15 Lars Vogel CLA 2016-09-13 12:08:28 EDT
Dani, please review and merge this. I'm using a window machine with a very high resolution at the customer and the Eclipse icon looks very "blurry" without this change.

I can't merge this, as I'm not a committer on eclipse.platform.
Comment 16 David Williams CLA 2016-09-15 23:32:23 EDT
(In reply to David Williams from comment #11)
> Let's move to SWT for comment and/or consideration on a "better way to fix". 
> 
> SWT Team, 
> 
> This is sort of (indirectly) related to bug 435222 (about emblems on Linux). 
> 
> But in general, I think each platform has their own "specs" on what type of
> image to display in the platform-specific constructs (like 'launchers',
> 'tiles', etc.) so IMHO the "windows images list" (which is not platform
> specific) is not a viable way to "provide images". 
> 
> Any comment? Insights?

I have confirmed, using a local build, that adding more icons to this list (still) "takes away" the "emblem" working on Linux, even on Ubuntu 16.04. 

I say this and care about this not so much due to "blurry on Windows" or "no emblem on Linux" -- though, of course, that is the decision that someone will have to make with the current proposal -- but instead I am concerned that this is a "quick and dirty" fix without being justified by the "specs" each OS provides to developers for those platforms. In a sense, I suspect this sort of "works by chance". And, breaks other things "by chance". 

A correct fix, IMHO, would be for someone to go through the "specs" for all modern platforms and provide the right-sized and type icons each platform is expecting. I do not know if the following are exactly the correct "specs" to follow, but they illustrate how each platform is different in what they expect. 

https://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html

https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/OSXHIGuidelines/Designing.html

https://msdn.microsoft.com/en-us/windows/uwp/controls-and-patterns/tiles-and-notifications-app-assets

= = = = = = = = = = 

Also, if anything, I would think "standard OS" icons should come from the Window ico file and the Mac icns file and only on Linux do you need a "simple list" as we have in the plugin.xml file. That might still be a "quick fix" in SWT, if they know they are getting a request from the operating system, vs. just some other part of our code. That is, both the ico and icns file do already have higher resolution icons in them, made specifically for the OS. 

= = = = = = = = = = 

So, I've already spent too much time on this issue :) and I will be quiet now. 
Good luck solving this hard problem! And thanks for paying attention to it.
Comment 17 Lars Vogel CLA 2016-10-31 12:13:29 EDT
Mass move to M4.
Comment 18 Lars Vogel CLA 2017-01-23 11:44:22 EST
Mass move. Please move to a concrete milestone if you plan to work on this item.
Comment 19 Lars Vogel CLA 2020-06-02 06:30:58 EDT
Alex, I think this one got fixed over the last years. Please reopen if that is not the case.
Comment 20 Alex Blewitt CLA 2020-06-02 09:12:02 EDT
Still an issue
Comment 21 Alex Blewitt CLA 2020-06-02 09:20:22 EDT
Created attachment 283119 [details]
Blurred icon in launched product
Comment 22 Lars Vogel CLA 2020-06-02 11:57:53 EDT
(In reply to Alex Blewitt from comment #21)
> Created attachment 283119 [details]
> Blurred icon in launched product


Lakshmi, is this a Mac issue? Icons looks good to me on Linux (may depend on monitor resolution).