Bug 1354619 - Allow nsWindow::SetTransparencyMode when it preserves current mode. r=mconley, a=gchang
authorLee Salzman <lsalzman@mozilla.com>
Wed, 12 Apr 2017 16:36:20 -0400
changeset 375931 ed4e7993e34d7765b86ba74dd5736e4e33b699ca
parent 375930 fc6add581f8897bfc8a726766d23b1b1928ec1ac
child 375932 e53f7f1785ebedaf692d599d70e3a7a9e1bb5f4f
push id11058
push userryanvm@gmail.com
push dateFri, 14 Apr 2017 20:06:37 +0000
treeherdermozilla-aurora@e53f7f1785eb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley, gchang
bugs1354619
milestone54.0a2
Bug 1354619 - Allow nsWindow::SetTransparencyMode when it preserves current mode. r=mconley, a=gchang MozReview-Commit-ID: FEqPTGlpbjE
widget/gtk/nsWindow.cpp
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -4265,26 +4265,25 @@ nsWindow::SetTransparencyMode(nsTranspar
         nsWindow *topWindow = get_window_for_gtk_widget(topWidget);
         if (!topWindow)
             return;
 
         topWindow->SetTransparencyMode(aMode);
         return;
     }
 
-    if (mWindowType != eWindowType_popup) {
+    bool isTransparent = aMode == eTransparencyTransparent;
+
+    if (mIsTransparent == isTransparent) {
+        return;
+    } else if (mWindowType != eWindowType_popup) {
         NS_WARNING("Cannot set transparency mode on non-popup windows.");
         return;
     }
 
-    bool isTransparent = aMode == eTransparencyTransparent;
-
-    if (mIsTransparent == isTransparent)
-        return;
-
     if (!isTransparent) {
         ClearTransparencyBitmap();
     } // else the new default alpha values are "all 1", so we don't
     // need to change anything yet
 
     mIsTransparent = isTransparent;
 
     // Need to clean our LayerManager up while still alive because