Bug 1523556 - [Linux/Gtk+] Don't apply titlebar shape mask to maximized windows, r=dao a=lizzard
authorMartin Stransky <stransky@redhat.com>
Thu, 07 Feb 2019 12:28:48 +0000
changeset 516129 2589bf262f6576b3e0bce80179c54691fc28c21e
parent 516128 aab4fc980d3cda9ea781c95f4e331d7291ef75ed
child 516130 91995baa7317a9f8db9ce9e2882479f54ec5f94e
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao, lizzard
bugs1523556
milestone66.0
Bug 1523556 - [Linux/Gtk+] Don't apply titlebar shape mask to maximized windows, r=dao a=lizzard Differential Revision: https://phabricator.services.mozilla.com/D18823
widget/gtk/nsWindow.cpp
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -1923,24 +1923,28 @@ gboolean nsWindow::OnExposeEvent(cairo_t
 
   // Our bounds may have changed after calling WillPaintWindow.  Clip
   // to the new bounds here.  The region is relative to this
   // window.
   region.And(region, LayoutDeviceIntRect(0, 0, mBounds.width, mBounds.height));
 
   bool shaped = false;
   if (eTransparencyTransparent == GetTransparencyMode()) {
+    auto window = static_cast<nsWindow *>(GetTopLevelWidget());
     if (mTransparencyBitmapForTitlebar) {
-      static_cast<nsWindow *>(GetTopLevelWidget())
-          ->UpdateTitlebarTransparencyBitmap();
+      if (mSizeState == nsSizeMode_Normal) {
+        window->UpdateTitlebarTransparencyBitmap();
+      } else {
+        window->ClearTransparencyBitmap();
+      }
     } else {
       if (mHasAlphaVisual) {
         // Remove possible shape mask from when window manger was not
         // previously compositing.
-        static_cast<nsWindow *>(GetTopLevelWidget())->ClearTransparencyBitmap();
+        window->ClearTransparencyBitmap();
       } else {
         shaped = true;
       }
     }
   }
 
   if (!shaped) {
     GList *children = gdk_window_peek_children(mGdkWindow);
@@ -6129,17 +6133,17 @@ void nsWindow::SetDrawsInTitlebar(bool a
     }
 
     gtk_widget_destroy(tmpWindow);
   }
 
   mDrawInTitlebar = aState;
 
   if (mTransparencyBitmapForTitlebar) {
-    if (mDrawInTitlebar) {
+    if (mDrawInTitlebar && mSizeState == nsSizeMode_Normal) {
       UpdateTitlebarTransparencyBitmap();
     } else {
       ClearTransparencyBitmap();
     }
   }
 }
 
 gint nsWindow::GdkScaleFactor() {