Bug 1420820 - Added MOZ_GTK_TITLEBAR_DECORATION to override window manager detection and set window decoration type, r?jhorak
Enables override window manager default with those values:
MOZ_GTK_TITLEBAR_DECORATION=none - Firefox does not mess with decoration
MOZ_GTK_TITLEBAR_DECORATION=client - Firefox tries to disable titlebar rendering and draws shadows by client side decorations.
MOZ_GTK_TITLEBAR_DECORATION=system - Firefox tries to disable titlebar rendering and leave system (window manager) to draw window decorations.
MozReview-Commit-ID: G60QS3g1TD0
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -6935,16 +6935,29 @@ nsWindow::DoDrawTitlebar() const
return mIsCSDEnabled && mSizeState == nsSizeMode_Normal;
}
nsWindow::CSDSupportLevel
nsWindow::GetCSDSupportLevel() {
if (sCSDSupportLevel != CSD_SUPPORT_UNKNOWN) {
return sCSDSupportLevel;
}
+
+ const char* decorationOverride = getenv("MOZ_GTK_TITLEBAR_DECORATION");
+ if (decorationOverride) {
+ if (strcmp(decorationOverride, "none") == 0) {
+ sCSDSupportLevel = CSD_SUPPORT_NONE;
+ } else if (strcmp(decorationOverride, "client") == 0) {
+ sCSDSupportLevel = CSD_SUPPORT_FLAT;
+ } else if (strcmp(decorationOverride, "system") == 0) {
+ sCSDSupportLevel = CSD_SUPPORT_FULL;
+ }
+ return sCSDSupportLevel;
+ }
+
const char* currentDesktop = getenv("XDG_CURRENT_DESKTOP");
if (currentDesktop) {
if (strstr(currentDesktop, "GNOME") != nullptr) {
sCSDSupportLevel = CSD_SUPPORT_FULL;
} else if (strstr(currentDesktop, "XFCE") != nullptr) {
sCSDSupportLevel = CSD_SUPPORT_FLAT;
} else if (strstr(currentDesktop, "X-Cinnamon") != nullptr) {
sCSDSupportLevel = CSD_SUPPORT_FULL;