NSWindow's shadow disappears after deminiaturize:

Kind of a strange bug I see in an app app i'm working on. My guess is that maybe something going on with Core Animation + Appkit, though I'm not quite sure. Anyone hit this before?

Well, I can't seem to figure out what's going on but it has to do with Core Animation because if I turn of layer backing on the window's contentView the problem goes away. However, I need layer backing for certain controls in this window.


I tried to implement windowDidDeminiaturize: and calling all sorts of methods....


invalidateShadow:

display:

self.window.contentView setNeedsDisplay:


but the window shadow refuses to redraw...it only comes back after changing the window's frame size in an animation context blcok. So this nasty workaround will do it:


-(void)windowDidMiniaturize:(NSNotification *)notification
{
  //change the frame size...have to change the height.
    NSRect frame = self.window.frame;
    frame.size.width = frame.size.width-1.0;
    frame.size.height = frame.size.height-1.0;


    [self.window setFrame:frame
                  display:YES];

}


-(void)windowDidDeminiaturize:(NSNotification *)notification
{
//CHange the  window frame back
}

a. Submit a bug report.


b. Can you work around the problem by adding a custom view between the content view and its current child views? Turn on layer backing for the custom view (and hence all the children), but leave it off for the content view. Might work.

Hey Quincey,


Yeah..I know bug reports are good to submit. I've submitted lots of bugs. Haven't gotten around to this one.


I already tried your suggesstion earlier, was thinking the same thing but it didn't work.

NSWindow's shadow disappears after deminiaturize:
 
 
Q