Community
Participate
Working Groups
Created attachment 277106 [details] Screenshot of Table with wrong sort column background color. This issue was discovered while working on a custom Dark theme for our product. The issue arises when a Tree/Table and it's backgroundControl (from findBackgroundControl()) have the same background. From CSSSWTColorHelper.java /** Helper function to avoid setting colors unnecessarily */ public static void setBackground(Control control, Color newColor) { if (!equals(control.getBackground(), newColor)) { control.setBackground(newColor); } } If the newColor is the same color as the Tree's backgroundControl then we will never call control.setBackground() which will leave Control.background = -1. Later when a Tree goes to render and it calls getSortColumnPixel(), that function does not look at the backgroundControl, it calls getBackgroundPixel() which looks directly at Control.background. Since Control.background is -1, it will return OS.GetSysColor(OS.COLOR_WINDOW) which in my case was white. I believe(am not certain) the fix is to fix getBackgroundPixel so that it looks at the backgroundControl's color. The workaround was to force Trees and Tables to be a different color then other backgrounds in CSS.
This issue exists on Linux as well.
(In reply to Mike Marchand from comment #1) > This issue exists on Linux as well. Which distribution and GTK3 version?
It was a coworker's VM running 18.04.1 LTS, I am unsure which GTK version they were using. I might be able to provide an update on that tomorrow.
The gtk version is 3.22.30
Is it reproducible in a pure SWT snippet? If so, can you post it here?
I never followed up from your question. At the time I was unable to get this to reproduce with a pure swt snippet.
(In reply to Mike Marchand from comment #6) > I never followed up from your question. At the time I was unable to get > this to reproduce with a pure swt snippet. Also not reproducible in Eclipse dark-theme. Marking as works for me.