You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Windows Hi-DPI] Program icons have black background #715
Windows 10/11
Eclipse 4.28
Windows hi-dpi scaling at 200%.
Some program icons in Package Explorer and Project Explorer have a black background:
Sometimes, the icons render correctly.
I can't reproduce this with a stand-alone SWT snippet so it seems to suggest that it's caused by Eclipse doing things in a certain order, or something else affects it in the UI.
Hi @Phillipus,
For me this looks to be similar issue reported in pr #409. Can you please review that issue if that might give you some clue towards this problem.
Thanks
Hi @Phillipus, For me this looks to be similar issue reported in pr #409. Can you please review that issue if that might give you some clue towards this problem. Thanks
Hi @deepika-u I tested running a child Eclipse with the SWT PR (and the PR in Platform UI) but, unfortunately, the program icons still have a black background.
Yes, this is quite an old problem. BTW, I think these come from org.eclipse.swt.program.Program.getPrograms() and from there via org.eclipse.swt.program.Program.getImageData() which works it's way tout of org.eclipse.ui.internal.misc.ExternalProgramImageDescriptor.getImageData() eventually. Unfortunately org.eclipse.swt.tests.win32.snippets.SWTIssue185.createImages(Display, String...) does not not reproduce the problem.
Hi, I tried the below images in the snippet. Please check if you are able to recreate the problem with this snippet.
package org.eclipse.swt.bugs;
import org.eclipse.swt.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
public class SWTIconExample {
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setText("Excel and Chrome Icons");
shell.setLayout(new GridLayout(2, false));
// Load the Excel icon
Image excelIcon = new Image(display, "C:\\Users\\02236C744\\Desktop\\zoom_icons\\ExcelLogoSmall.scale-100.png");
// Load the Chrome icon
Image chromeIcon = new Image(display, "C:\\Users\\02236C744\\Desktop\\zoom_icons\\chrome.png");
// Load the Firefox icon
Image firefoxIcon = new Image(display, "C:\\Users\\02236C744\\Desktop\\zoom_icons\\VisualElements_70.png");
// Load the Edge icon
Image edgeIcon = new Image(display, "C:\\Users\\02236C744\\Desktop\\zoom_icons\\edge.png");
// Load the MSWord icon
Image mswordIcon = new Image(display, "C:\\Users\\02236C744\\Desktop\\zoom_icons\\WinWordLogoSmall.scale-100.png");
// Label to display the Excel icon
Label excelLabel = new Label(shell, SWT.NONE);
excelLabel.setImage(excelIcon);
excelLabel.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, true));
// Label to display the Chrome icon
Label chromeLabel = new Label(shell, SWT.NONE);
chromeLabel.setImage(chromeIcon);
chromeLabel.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, true));
// Label to display the Firefox icon
Label firefoxLabel = new Label(shell, SWT.NONE);
firefoxLabel.setImage(firefoxIcon);
firefoxLabel.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, true));
// Label to display the Edge icon
Label edgeLabel = new Label(shell, SWT.NONE);
edgeLabel.setImage(edgeIcon);
edgeLabel.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, true));
// Label to display the MSWord icon
Label mswordLabel = new Label(shell, SWT.NONE);
mswordLabel.setImage(mswordIcon);
mswordLabel.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, true));
shell.pack();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
// Remember to dispose of the images
excelIcon.dispose();
chromeIcon.dispose();
firefoxIcon.dispose();
edgeIcon.dispose();
mswordIcon.dispose();
display.dispose();
}
}
I have picked the images at that path from below locations already existing in my windows 11 instance.
firefox => C:\Program Files\Mozilla Firefox\browser\VisualElements
excel, word => C:\Program Files\Microsoft Office\root\Office16\LogoImages
chrome, edge => C:\Program Files\Microsoft Office\root\Office16\sdxs\FA000000070\assets\src\assets\images
edge => C:\Program Files (x86)\Microsoft\Edge\Application\115.0.1901.203\VisualElements
Let me know if anyone is able to recreate the issue atleast i am not successful.
Activity
deepika-u commentedon Jun 30, 2023
Hi @Phillipus,
For me this looks to be similar issue reported in pr #409. Can you please review that issue if that might give you some clue towards this problem.
Thanks
Phillipus commentedon Jun 30, 2023
Hi @deepika-u I tested running a child Eclipse with the SWT PR (and the PR in Platform UI) but, unfortunately, the program icons still have a black background.
I think it's related to #185
Phillipus commentedon Jun 30, 2023
Actually, it's not a recent regression. The problem exists in Eclipse 4.8 (June 2018)
merks commentedon Jun 30, 2023
Yes, this is quite an old problem. BTW, I think these come from org.eclipse.swt.program.Program.getPrograms() and from there via org.eclipse.swt.program.Program.getImageData() which works it's way tout of org.eclipse.ui.internal.misc.ExternalProgramImageDescriptor.getImageData() eventually. Unfortunately org.eclipse.swt.tests.win32.snippets.SWTIssue185.createImages(Display, String...) does not not reproduce the problem.
Phillipus commentedon Jun 30, 2023
And I can't reproduce it in a stand-alone SWT snippet. And the infuriating thing is (in terms of debugging) is that sometimes the icons render OK!
Phillipus commentedon Jul 2, 2023
In the
org.eclipse.swt.program.Programclass starting at line 363:If I change line 366 to one of the following the icon is displayed correctly:
I've no idea what those flags mean or why this should be the case, but maybe a clue there?
Phillipus commentedon Jul 2, 2023
In fact, if I comment out all of this, it works:
deepika-u commentedon Aug 17, 2023
Hi, I tried the below images in the snippet. Please check if you are able to recreate the problem with this snippet.
I have picked the images at that path from below locations already existing in my windows 11 instance.
firefox => C:\Program Files\Mozilla Firefox\browser\VisualElements
excel, word => C:\Program Files\Microsoft Office\root\Office16\LogoImages
chrome, edge => C:\Program Files\Microsoft Office\root\Office16\sdxs\FA000000070\assets\src\assets\images
edge => C:\Program Files (x86)\Microsoft\Edge\Application\115.0.1901.203\VisualElements
Let me know if anyone is able to recreate the issue atleast i am not successful.
Phillipus commentedon Aug 17, 2023
@deepika-u I can't reproduce this with a stand-alone snippet. As mentioned before it seems to depend on the order of events.
deepika-u commentedon Jan 4, 2024
@Phillipus
Can you please check below snippet
Hope this should help you recreate the problem.
Phillipus commentedon Jan 4, 2024
@deepika-u This is the result of the Snippet. It doesn't recreate the problem.
deepika-u commentedon Jan 4, 2024
@Phillipus : have you got to try with 200% resolution? is it the same? sorry to ask you again.
Phillipus commentedon Jan 4, 2024
Yes, that's at 200%.
[Win32] Extract alpha value from icons if available eclipse-platform#715
[Win32] Extract alpha values from icons if available eclipse-platform…
32 remaining items
[Win32] Extract alpha values from icons if available eclipse-platform…
Revert "[Win32] Remove buggy icon retrieval from file extensions ecli…
[Win32] Extract alpha values from icons if available eclipse-platform…
Revert "[Win32] Remove buggy icon retrieval from file extensions ecli…
[Win32] Extract alpha values from icons if available eclipse-platform…
Revert "[Win32] Remove buggy icon retrieval from file extensions ecli…
[Win32] Extract alpha values from icons if available eclipse-platform…
Revert "[Win32] Remove buggy icon retrieval from file extensions ecli…
[Win32] Extract alpha values from icons if available eclipse-platform…
[Win32] Extract alpha values from icons if available eclipse-platform…
Revert "[Win32] Remove buggy icon retrieval from file extensions #715"
[Win32] Extract alpha values from icons if available #715 #1130
[Win32] Extract alpha values from icons if available eclipse-platform…
[Win32] Extract alpha values from icons if available eclipse-platform…
[Win32] Extract alpha values from icons if available eclipse-platform…