Bug 1420061 - Don't duplicate window controls when titlebar is enabled. r=mstange
authorKartikaya Gupta <kgupta@mozilla.com>
Tue, 31 Jul 2018 09:14:10 -0400
changeset 487126 18f39664639af76d5dc5c693b3ba9f2aadc8b32d
parent 487125 98d1a1eecb8d4c4547ab77326d4cbc5c3003901f
child 487127 a88da0466145ada32a70e8c97726a5e490d9364a
push id1815
push userffxbld-merge
push dateMon, 15 Oct 2018 10:40:45 +0000
treeherdermozilla-release@18d4c09e9378 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1420061
milestone63.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 1420061 - Don't duplicate window controls when titlebar is enabled. r=mstange This copies over the early-exit conditions from MaybeDrawTitlebar which is the non-WR codepath where this gets drawn. In particular, the !mIsCoveringTitlebar clause is true when the titlebar is enabled. MozReview-Commit-ID: 6B7vKYuyrRP
widget/cocoa/nsChildView.mm
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -2090,16 +2090,20 @@ nsChildView::CleanupWindowEffects()
 
 void
 nsChildView::AddWindowOverlayWebRenderCommands(layers::WebRenderBridgeChild* aWrBridge,
                                                wr::DisplayListBuilder& aBuilder,
                                                wr::IpcResourceUpdateQueue& aResources)
 {
   PrepareWindowEffects();
 
+  if (!mIsCoveringTitlebar || mIsFullscreen || mTitlebarRect.IsEmpty()) {
+    return;
+  }
+
   bool needUpdate = mUpdatedTitlebarRegion.Intersects(mTitlebarRect);
   mUpdatedTitlebarRegion.SetEmpty();
 
   if (mTitlebarCGContext) {
     gfx::IntSize size(CGBitmapContextGetWidth(mTitlebarCGContext),
                       CGBitmapContextGetHeight(mTitlebarCGContext));
     size_t stride = CGBitmapContextGetBytesPerRow(mTitlebarCGContext);
     size_t titlebarCGContextDataLength = stride * size.height;