Review request for 7124236: [macosx] Some components lost shadows after the latest fix of translucent windows.

Dmitry Cherepanov dmitry.cherepanov at
Fri Feb 3 04:05:21 PST 2012

Anthony Petrov wrote:
> Hi Dmitry,
> Major concern: is that possible to avoid modifications to the shared 
> code with this fix?

I'm afraid that this is a necessary change if we want to create a 
CALayer where the background is fully transparent. Also, having fully 
transparent background in CALayer seems to be necessary to implement . I'm currently trying to 
come up with a fix for the native textured background and likely I'll 
submit a separate review request for MACOSX_PORT-764.
> On 1/31/2012 11:04 PM, Dmitry Cherepanov wrote:
>> The cause of the problem with broken shadows is that currently 
>> NSWindow's background color is [NSWindow clearColor] and it makes 
>> shadows invisible. The fix implements Mike's suggestion and now we 
>> draw pure transparent pixels into a CALayer so that the native 
>> background color will be visible through transparent areas of the 
>> CALayer.
> Looks like it should work fine if background's alpha is > 0 and < 255. 
> And what about window.setBackground(new Color(0, 0, 0, 0))? I see that 
> in CPlatformWindow we'll actually pass these zeros (which is in fact 
> the same as the clearColor, isn't it?) to the native system. In this 
> case I wouldn't expect any shadow to appear since the background color 
> set is completely transparent. Is this correct?

I would also expect that there shouldn't be any shadow after setting 
window.setBackground(new Color(0, 0, 0, 0)) and this is how it behaves now.
> Also, the bug evaluation mentions the click-through problem. Is it 
> resolved with this fix?

The patch doesn't solve the click-through problem. I've spent a while 
investigating this issue and there's a number of mailing threads (for 
example, [1] and [2]) mentioning that OpenGL content is opaque to events.




More information about the macosx-port-dev mailing list