Bug 1523556 - [Linux/Gtk+] Don't apply titlebar shape mask to maximized windows, r=dao
authorMartin Stransky <stransky@redhat.com>
Thu, 07 Feb 2019 12:28:48 +0000
changeset 457607 f946a261f4fc355d5e3a2d25d5e7e5557bbd6dd5
parent 457606 6836ad129868dac54c41b17f0d70f6e5c962506e
child 457608 bdef8bbcf4932da65c95ac54a08ed20648a7fca0
push id35516
push userrmaries@mozilla.com
push dateFri, 08 Feb 2019 04:23:26 +0000
treeherdermozilla-central@d599d1a73a3a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs1523556
milestone67.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 1523556 - [Linux/Gtk+] Don't apply titlebar shape mask to maximized windows, r=dao 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);
@@ -6136,17 +6140,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() {