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

--HG--
extra : rebase_source : fd7b5d2b0282fbd54046947d210b1288a0610a23
This commit is contained in:
Martin Stransky 2017-12-04 15:19:00 +01:00
Родитель 615d7d25b4
Коммит 51d1404cde
1 изменённых файлов: 13 добавлений и 0 удалений

Просмотреть файл

@ -6940,6 +6940,19 @@ 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) {