mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 21:00:50 +00:00
Bug 831829 - Fix OSX titlebar painting from being upside-down and tiled. r=roc
This commit is contained in:
parent
f83cf21406
commit
b567e17307
@ -672,7 +672,10 @@ nsChildView::WillPaint()
|
||||
}
|
||||
NSRect flippedTitlebarRect = { NSZeroPoint, titlebarRect.size };
|
||||
CGContextRef context = mTitlebarSurf->GetCGContext();
|
||||
|
||||
CGContextSaveGState(context);
|
||||
[(ChildView*)mView drawRect:flippedTitlebarRect inTitlebarContext:context];
|
||||
CGContextRestoreGState(context);
|
||||
}
|
||||
|
||||
void
|
||||
@ -2518,7 +2521,7 @@ NSEvent* gLastDragMouseDownEvent = nil;
|
||||
const NSRect *rects;
|
||||
NSInteger count, i;
|
||||
[[NSView focusView] getRectsBeingDrawn:&rects count:&count];
|
||||
if (count < MAX_RECTS_IN_REGION) {
|
||||
if (count < MAX_RECTS_IN_REGION && !aIsAlternate) {
|
||||
for (i = 0; i < count; ++i) {
|
||||
// Add the rect to the region.
|
||||
NSRect r = [self convertRect:rects[i] fromView:[NSView focusView]];
|
||||
|
@ -2963,12 +2963,7 @@ TitlebarDrawCallback(void* aInfo, CGContextRef aContext)
|
||||
if (!view || ![view isKindOfClass:[ChildView class]])
|
||||
return;
|
||||
|
||||
// Gecko drawing assumes flippedness, but the current context isn't flipped
|
||||
// (because we're painting into the window's border view, which is not a
|
||||
// ChildView, so it isn't flipped).
|
||||
// So we need to set a flip transform.
|
||||
CGContextScaleCTM(aContext, 1.0f, -1.0f);
|
||||
CGContextTranslateCTM(aContext, 0.0f, -[window frame].size.height);
|
||||
CGContextTranslateCTM(aContext, 0.0f, [window frame].size.height - titlebarRect.size.height);
|
||||
|
||||
[(ChildView*)view drawTitlebar:[window frame] inTitlebarContext:aContext];
|
||||
} else {
|
||||
|
@ -940,7 +940,7 @@ LayerManager* nsBaseWidget::GetLayerManager(PLayersChild* aShadowManager,
|
||||
}
|
||||
}
|
||||
if (!mLayerManager) {
|
||||
mBasicLayerManager = mLayerManager = CreateBasicLayerManager();
|
||||
mLayerManager = CreateBasicLayerManager();
|
||||
}
|
||||
}
|
||||
if (mTemporarilyUseBasicLayerManager && !mBasicLayerManager) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user