Bug 1392574 - Don't attempt to composite a titlebar image if we don't have any. r?mattwoodrow
MozReview-Commit-ID: 59NKegwszzO
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -2410,17 +2410,17 @@ nsChildView::UpdateTitlebarCGContext()
// them works as expected - but their visual representation is only drawn into
// the normal window buffer, and the window buffer surface lies below the
// GLContext surface. In order to make the titlebar controls visible, we have
// to redraw them inside the OpenGL context surface.
void
nsChildView::MaybeDrawTitlebar(GLManager* aManager)
{
MutexAutoLock lock(mEffectsLock);
- if (!mIsCoveringTitlebar || mIsFullscreen) {
+ if (!mIsCoveringTitlebar || mIsFullscreen || mTitlebarRect.IsEmpty()) {
return;
}
LayoutDeviceIntRegion updatedTitlebarRegion;
updatedTitlebarRegion.And(mUpdatedTitlebarRegion, mTitlebarRect);
updatedTitlebarRegion.MoveBy(-mTitlebarRect.TopLeft());
mUpdatedTitlebarRegion.SetEmpty();