Bug 1414774 - Initialize sCSDCloseButton/sCSDMaximizeButton/sCSDMinimizeButton, r?jhorak
MozReview-Commit-ID: 10Yk1gFu0Vk
--- a/widget/gtk/nsLookAndFeel.cpp
+++ b/widget/gtk/nsLookAndFeel.cpp
@@ -1079,16 +1079,22 @@ nsLookAndFeel::EnsureInit()
// Require GTK 3.20 for client-side decoration support.
sCSDAvailable = gtk_check_version(3, 20, 0) == nullptr;
if (sCSDAvailable) {
sCSDAvailable =
mozilla::Preferences::GetBool("widget.allow-client-side-decoration",
false);
}
+ // We need to initialize whole CSD config explicitly because it's queried
+ // as -moz-gtk* media features.
+ sCSDCloseButton = false;
+ sCSDMaximizeButton = false;
+ sCSDMinimizeButton = false;
+
if (sCSDAvailable) {
static auto sGtkHeaderBarGetDecorationLayoutPtr =
(const gchar* (*)(GtkWidget*))
dlsym(RTLD_DEFAULT, "gtk_header_bar_get_decoration_layout");
GtkWidget* headerBar = GetWidget(MOZ_GTK_HEADER_BAR);
const gchar* decorationLayout =
sGtkHeaderBarGetDecorationLayoutPtr(headerBar);