Backed out changeset 38b37dfa1f33 (bug 1469716) for causing Bug 1572116. a=backout
authorCsoregi Natalia <ncsoregi@mozilla.com>
Fri, 16 Aug 2019 04:36:30 +0300
changeset 488331 9229fd85bc05af4c33c8cb8f5e489eca1043722d
parent 488251 b283a7ef186c216d765631f6cb1260a3fa2ee42c
child 488383 a58b7dc85887bcc257f525c2ae1df4427f1df613
push id113906
push userncsoregi@mozilla.com
push dateFri, 16 Aug 2019 04:07:24 +0000
treeherdermozilla-inbound@d887276421d3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1469716, 1572116
milestone70.0a1
backs out38b37dfa1f333de0785a1282f487549992698477
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
Backed out changeset 38b37dfa1f33 (bug 1469716) for causing Bug 1572116. a=backout
widget/gtk/nsWindow.cpp
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -3706,16 +3706,24 @@ nsresult nsWindow::Create(nsIWidget* aPa
           GdkVisual* visual = gdk_screen_get_rgba_visual(screen);
           if (visual) {
             gtk_widget_set_visual(mShell, visual);
             mHasAlphaVisual = true;
           }
         }
       }
 
+      // We have a toplevel window with transparency. Mark it as transparent
+      // now as nsWindow::SetTransparencyMode() can't be called after
+      // nsWindow is created (Bug 1344839).
+      if (mWindowType == eWindowType_toplevel &&
+          (mHasAlphaVisual || mTransparencyBitmapForTitlebar)) {
+        mIsTransparent = true;
+      }
+
       // We only move a general managed toplevel window if someone has
       // actually placed the window somewhere.  If no placement has taken
       // place, we just let the window manager Do The Right Thing.
       NativeResize();
 
       if (mWindowType == eWindowType_dialog) {
         SetDefaultIcon();
         gtk_window_set_wmclass(GTK_WINDOW(mShell), "Dialog",
@@ -4439,39 +4447,31 @@ void nsWindow::SetTransparencyMode(nsTra
     topWindow->SetTransparencyMode(aMode);
     return;
   }
 
   bool isTransparent = aMode == eTransparencyTransparent;
 
   if (mIsTransparent == isTransparent) {
     return;
-  }
-  if (mWindowType != eWindowType_popup && !mHasAlphaVisual &&
-      !mTransparencyBitmapForTitlebar) {
-    // https://bugzilla.mozilla.org/show_bug.cgi?id=1344839 reported
-    // problems cleaning the layer manager for toplevel windows, so ignore
-    // the request to workaround that.
+  } else if (mWindowType != eWindowType_popup) {
     NS_WARNING("Cannot set transparency mode on non-popup windows.");
     return;
   }
 
   if (!isTransparent) {
     ClearTransparencyBitmap();
   }  // else the new default alpha values are "all 1", so we don't
   // need to change anything yet
 
   mIsTransparent = isTransparent;
 
-  if (!mHasAlphaVisual && !mTransparencyBitmapForTitlebar) {
-    // The choice of layer manager depends on
-    // GtkCompositorWidgetInitData::Shaped(), which will need to change, so
-    // clean out the old layer manager.
-    CleanLayerManagerRecursive();
-  }
+  // Need to clean our LayerManager up while still alive because
+  // we don't want to use layers acceleration on shaped windows
+  CleanLayerManagerRecursive();
 }
 
 nsTransparencyMode nsWindow::GetTransparencyMode() {
   if (!mShell) {
     // Pass the request to the toplevel window
     GtkWidget* topWidget = GetToplevelWidget();
     if (!topWidget) {
       return eTransparencyOpaque;