Bug 1344839 - Don't allow transparent top-level windows on GTK. r=karlt, a=gchang
authorMike Conley <mconley@mozilla.com>
Tue, 21 Mar 2017 22:15:36 -0400
changeset 395817 49d5a4f14a0711ee2e7daacbea147024e7e209c4
parent 395816 1c79bcfea67971696983deeadb0bc22f7158dd1e
child 395818 e261ddc45da9f6f551540893954815b1264a2bb1
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt, gchang
bugs1344839
milestone54.0a2
Bug 1344839 - Don't allow transparent top-level windows on GTK. r=karlt, a=gchang MozReview-Commit-ID: 9UP1UYcaF2F
widget/gtk/nsWindow.cpp
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -4264,16 +4264,22 @@ nsWindow::SetTransparencyMode(nsTranspar
 
         nsWindow *topWindow = get_window_for_gtk_widget(topWidget);
         if (!topWindow)
             return;
 
         topWindow->SetTransparencyMode(aMode);
         return;
     }
+
+    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