Bug 1423407: Add mozilla.widget.gtk.force-disable-argb-visuals to force widgets to not have transparency. r?mstange draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Wed, 06 Dec 2017 02:25:11 +0100
changeset 707924 f37107193a389d6c05ce1b6cf3cb3b490e031af2
parent 707855 e4b40b62090156cee8179034cc60465f9e93dafe
child 743071 0694c3bb729952776826459791595f81ecf98362
push id92255
push userbmo:emilio@crisal.io
push dateWed, 06 Dec 2017 01:27:02 +0000
reviewersmstange
bugs1423407, 1418212
milestone59.0a1
Bug 1423407: Add mozilla.widget.gtk.force-disable-argb-visuals to force widgets to not have transparency. r?mstange This allows to work around bugs like bug 1418212. It's not pretty, I know :( MozReview-Commit-ID: 5MphwwrrvxI
widget/gtk/nsWindow.cpp
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -3660,16 +3660,19 @@ nsWindow::Create(nsIWidget* aParent,
 
         bool useAlphaVisual = (mWindowType == eWindowType_popup &&
                                aInitData->mSupportTranslucency);
 
         // mozilla.widget.use-argb-visuals is a hidden pref defaulting to false
         // to allow experimentation
         if (Preferences::GetBool("mozilla.widget.use-argb-visuals", false))
             useAlphaVisual = true;
+        else if (useAlphaVisual &&
+                 Preferences::GetBool("mozilla.widget.gtk.force-disable-argb-visuals", false))
+            useAlphaVisual = false;
 
         // We need to select an ARGB visual here instead of in
         // SetTransparencyMode() because it has to be done before the
         // widget is realized.  An ARGB visual is only useful if we
         // are on a compositing window manager.
         if (useAlphaVisual) {
             GdkScreen *screen = gtk_widget_get_screen(mShell);
             if (gdk_screen_is_composited(screen)) {