Bug 1414774 - Initialize sCSDCloseButton/sCSDMaximizeButton/sCSDMinimizeButton, r?jhorak draft
authorMartin Stransky <stransky@redhat.com>
Mon, 06 Nov 2017 11:41:38 +0100
changeset 693476 be024f56fabd5f4fa9dad552fa06a54c46842e21
parent 692038 4780b851f68f9c352d19f1a0846d53a20fa0bc04
child 739051 d96b9b11a629468997a0b628934f8783e14976d9
push id87821
push userstransky@redhat.com
push dateMon, 06 Nov 2017 10:42:11 +0000
reviewersjhorak
bugs1414774
milestone58.0a1
Bug 1414774 - Initialize sCSDCloseButton/sCSDMaximizeButton/sCSDMinimizeButton, r?jhorak MozReview-Commit-ID: 10Yk1gFu0Vk
widget/gtk/nsLookAndFeel.cpp
--- 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);