Community
Participate
Working Groups
After upgrading the SWT version of our app, I have noticed that setting the background on a top-level Composite no longer triggers a redraw of all children reliably. In our applications there are several Composites side by side as the "top-level" panel. (Like "Views" in Eclipse). Only one of the views contains the focus control and the entire area is "darkened" by setting a darker background color on the top-level Composite. This color was reliably inherited by the entire view hierachy in each top-level view. Since upgrading the SWT version from 4.9 to 4.17, the graphical update is no longer reliable. It works for one type of top-level view, but not for all the others. I could not determine what consitutes the difference of that view. What I could validate is that the children in the view which works receive Paint events, in the others they do not. These views only update after some other event causes them to repaint, like for example when the top-level Composite is resized. The work-around that I have found is to recursively call redraw() on all children, like this: topLevelComposite.setBackground(newColor); redrawRecursive(topLevelComposite.getChildren()); static void redrawRecursive(Control[] controls) { for (Control control : controls) { control.redraw(); if (control instanceof Composite) { Composite composite = (Composite) control; redrawRecursive(composite.getChildren()); } } }