Bug 888615 - [Australis] Only draw window titles for windows with drawtitle=true. r=smichaud
authorMarkus Stange <mstange@themasta.com>
Tue, 17 Dec 2013 17:19:25 +0100
changeset 160839 0abc0b17f9ced95269b87d7aa974be81294e905b
parent 160838 555a5f56c8477946e28f570e5de99d5901dbfe0b
child 160840 6bf48d4bbd146e5ac5e553d8293ec729534a4390
push id37722
push usermstange@themasta.com
push dateTue, 17 Dec 2013 16:19:57 +0000
treeherdermozilla-inbound@0abc0b17f9ce [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmichaud
bugs888615
milestone29.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 888615 - [Australis] Only draw window titles for windows with drawtitle=true. r=smichaud
widget/cocoa/nsChildView.mm
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -2261,17 +2261,17 @@ nsChildView::UpdateTitlebarCGContext()
   if (![frameView isFlipped]) {
     CGContextTranslateCTM(ctx, 0, [frameView bounds].size.height);
     CGContextScaleCTM(ctx, 1, -1);
   }
   NSGraphicsContext* context = [NSGraphicsContext graphicsContextWithGraphicsPort:ctx flipped:[frameView isFlipped]];
   [NSGraphicsContext setCurrentContext:context];
 
   // Draw the title string.
-  if ([frameView respondsToSelector:@selector(_drawTitleBar:)]) {
+  if ([window wantsTitleDrawn] && [frameView respondsToSelector:@selector(_drawTitleBar:)]) {
     [frameView _drawTitleBar:[frameView bounds]];
   }
 
   // Draw the titlebar controls into the titlebar image.
   for (id view in [window titlebarControls]) {
     NSRect viewFrame = [view frame];
     nsIntRect viewRect = CocoaPointsToDevPixels([mView convertRect:viewFrame fromView:frameView]);
     if (!dirtyTitlebarRegion.Intersects(viewRect)) {
@@ -3705,17 +3705,22 @@ NSEvent* gLastDragMouseDownEvent = nil;
   CGContextScaleCTM(aContext, -1, 1);
   CGContextDrawImage(aContext, destRect, mTopLeftCornerMask);
 
   CGContextRestoreGState(aContext);
 }
 
 - (void)drawTitleString
 {
-  NSView* frameView = [[[self window] contentView] superview];
+  BaseWindow* window = (BaseWindow*)[self window];
+  if (![window wantsTitleDrawn]) {
+    return;
+  }
+
+  NSView* frameView = [[window contentView] superview];
   if (![frameView respondsToSelector:@selector(_drawTitleBar:)]) {
     return;
   }
 
   NSGraphicsContext* oldContext = [NSGraphicsContext currentContext];
   CGContextRef ctx = (CGContextRef)[oldContext graphicsPort];
   CGContextSaveGState(ctx);
   if ([oldContext isFlipped] != [frameView isFlipped]) {