Bug 1105939 part 4 - Treat cocoa window without titlebar as fullscreen to avoid drawing rounded corners on it. r=mstange

This commit is contained in:
Xidorn Quan 2015-06-04 13:49:34 +12:00
parent e9ce54cca2
commit d90fba1c49
2 changed files with 5 additions and 2 deletions

View File

@ -1977,7 +1977,8 @@ nsChildView::PrepareWindowEffects()
CGFloat cornerRadius = [(ChildView*)mView cornerRadius];
mDevPixelCornerRadius = cornerRadius * BackingScaleFactor();
mIsCoveringTitlebar = [(ChildView*)mView isCoveringTitlebar];
mIsFullscreen = ([[mView window] styleMask] & NSFullScreenWindowMask) != 0;
NSInteger styleMask = [[mView window] styleMask];
mIsFullscreen = (styleMask & NSFullScreenWindowMask) || !(styleMask & NSTitledWindowMask);
if (mIsCoveringTitlebar) {
mTitlebarRect = RectContainingTitlebarControls();
UpdateTitlebarCGContext();

View File

@ -3330,7 +3330,9 @@ static const NSString* kStateCollectionBehavior = @"collectionBehavior";
- (NSPoint)windowButtonsPositionWithDefaultPosition:(NSPoint)aDefaultPosition
{
if ([self drawsContentsIntoWindowFrame] && !([self styleMask] & NSFullScreenWindowMask)) {
NSInteger styleMask = [self styleMask];
if ([self drawsContentsIntoWindowFrame] &&
!(styleMask & NSFullScreenWindowMask) && (styleMask & NSTitledWindowMask)) {
if (NSIsEmptyRect(mWindowButtonsRect)) {
// Empty rect. Let's hide the buttons.
// Position is in non-flipped window coordinates. Using frame's height