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
--- 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)) {