Bug 1392574 - Don't attempt to composite a titlebar image if we don't have any. r?mattwoodrow draft
authorMarkus Stange <mstange@themasta.com>
Thu, 07 Sep 2017 16:21:55 +0200
changeset 660783 6a9275060237f6fdd7822759a5c5fa671ab3a1a6
parent 660759 f4d0aaefd7285af89c3850ee002d1759588e9b4b
child 730354 d84b8062c7adc26e2bd361162a67ef3179f27b19
push id78528
push userbmo:mstange@themasta.com
push dateThu, 07 Sep 2017 14:22:29 +0000
reviewersmattwoodrow
bugs1392574
milestone57.0a1
Bug 1392574 - Don't attempt to composite a titlebar image if we don't have any. r?mattwoodrow MozReview-Commit-ID: 59NKegwszzO
widget/cocoa/nsChildView.mm
--- 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();