]
Friendly Jira Robot resolved ERT-742.
-------------------------------------
Resolution: Done
[GTK] Label background set from parent background, but the colors are
not equal [EBZ#549101]
--------------------------------------------------------------------------------------------
Key: ERT-742
URL:
https://issues.jboss.org/browse/ERT-742
Project: Eclipse Release Train
Issue Type: Task
Components: Platform
Reporter: Friendly Jira Robot
Priority: Major
Labels: 4.13_M3, SWT, bzira
To reproduce, run the following snippet:
public static void main(String[] args) throws Exception {
final Display display = new Display();
Shell shell = new Shell(display);
shell.setSize(500, 80);
shell.setLayout(new FillLayout(SWT.HORIZONTAL));
shell.setText("Bug");
Composite co = new Composite(shell, SWT.NONE);
co.setLayout(new FillLayout(SWT.HORIZONTAL));
Label l = new Label(co, SWT.NONE);
l.setBackground(co.getBackground());
boolean equalColors = l.getBackground().equals(co.getBackground());
l.setText("colors equal: " + equalColors);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch()) {
display.sleep();
}
}
display.dispose();
}
Observe that the label text indicates, that the background color of the label is not the
same as that of its parent. Although the snippet explicitly sets the same color.
Seems to be a regression from bug 548286:
https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=2d...
Prior to this change, the colors are equal. The difference is in some fractions of all
the colors (RGB).
We see this with latest Eclipse SDK 4.13, on RHEL 7.4 with GTK3. No idea if its also seen
on Windows 7/10 or Mac.