Community
Participate
Working Groups
The default implementation just returns true, but it should return false when style SWT.NO_BACKGROUND ist specified. This would resolve bug#238918, but also fix other controls. They call fillBackground(), which does a fast return when the NO_BACKGROUND style is applied.
New Gerrit change created: https://git.eclipse.org/r/110421
*** Bug 238918 has been marked as a duplicate of this bug. ***
Lakshmi would you please review this one?
Hi Karsten, In Cocoa code, Composite.drawBackground() already checks if SWT.NO_BACKGROUND is set and calls fillBackground() only if its not set. I didn't find any Control that has the SWT.NO_BACKGROUND style set. So, why is the check in Control.drawsBackground() required? Am I missing something?
I think I came to this as follows: - bug#238918 requests to evaluate SWT.NO_BACKGROUND for Toolbar - the attached patch wanted to evaluate this in Toolbar#drawBackground - that method calls Control#fillBackground - the first check there is calling drawsBackground and does a fast return if that evaluates to false => the better place to evaluate SWT.NO_BACKGROUND is in drawsBackground I think the problem is here that we cannot tell why the reporter wanted to evaluate it for a Toolbar, maybe this happens in custom code? Or asking the other way around: What is speaking against users setting this style to controls?
(In reply to Karsten Thoms from comment #5) > I think the problem is here that we cannot tell why the reporter wanted to > evaluate it for a Toolbar, maybe this happens in custom code? > Toolbar extends Composite, so NO_BACKGROUND will be checked in Composite.drawsBackground(). I'm not sure why he was evaluating the flag, the patch was for Carbon code, so can't say without looking at Carbon code. > Or asking the other way around: What is speaking against users setting this > style to controls? I think for native controls, the background is drawn by Cocoa and if we prevent the drawing, the correct background will not be drawn. If this is true, we cannot allow a flag in the client code to decide if the Control should/shouldn't draw the background.
Moving bug out of M4 to 4.8 for now.
Moving to 4.9, please re-target as required.
I believe there is nothing to be done here since SWT.NO_BACKGROUND should not be set for a Control (please see comment #6).