I got an issue with NSWindow
and it's content view - with appearance of title bar and rounded bottom corners to be specific. I'm observing the issue on 10.11 and on 10.10 everything looks fine. But to the point.
The title bar of the window looks like this:
and on the same time bottom looks like this:
No rounded corners. Window is initiated programmatically and it consists of two subviews added programmatically, by using self.contentView addSubview: method.
After some work found out, that adding
[self.contentView setWantsLayer:YES];
at the beginning of window init the tittle bar looks like this:
Flat and solid darker than normal color - not good. On the other hand bottom looks as I need it to look like:
I'm not allowed to show more of the windows. And here's the init with my experiments:
[self.contentView setWantsLayer:YES];
self.identifier = someid;
self.styleMask = NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask;
self.backingType = NSBackingStoreBuffered;
[self setFrame:NSMakeRect(0, 0, windowInitWidth, windowInitHeight) display:NO];
[self setBackgroundColor:[NSColor colorForKeyPath:@"blackcolor"]];
NSButton *windowButton = [self standardWindowButton:NSWindowCloseButton];
[windowButton setEnabled:NO];
[self centerOnMainWindowScreen];
[self setupLeftPanel];
[self setupRightPanel];
[self setupConstraints];
Any help, that will explain why is this happening (what is the order of drawing window elements?) and how to properly init window, appreciated. Once again: it's working fine on 10.10 both ways. 10.11 is causing corrupted drawing.