From 45ea89eb150b5ea9cf43cf03c065a14fbbeb95ba Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Mon, 19 Feb 2018 16:35:43 +0100 Subject: [PATCH] Bug 1433866 - Rename CSD_SUPPORT_FULL/FLAT to better names, r=jhorak MozReview-Commit-ID: 8btSuxa5oeT --HG-- extra : rebase_source : 775f98623f5fd9b11c6d7bb152ddf74fc8c7d7e1 --- widget/gtk/nsWindow.cpp | 42 ++++++++++++++++++++--------------------- widget/gtk/nsWindow.h | 6 +++--- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp index 4cb51c8ca6c8..629e0544c5bf 100644 --- a/widget/gtk/nsWindow.cpp +++ b/widget/gtk/nsWindow.cpp @@ -3747,7 +3747,7 @@ nsWindow::Create(nsIWidget* aParent, GtkStyleContext* style = gtk_widget_get_style_context(mShell); drawToContainer = !mIsX11Display || - (mIsCSDAvailable && GetCSDSupportLevel() == CSD_SUPPORT_FLAT ) || + (mIsCSDAvailable && GetCSDSupportLevel() == CSD_SUPPORT_CLIENT) || gtk_style_context_has_class(style, "csd"); eventWidget = (drawToContainer) ? container : mShell; @@ -6540,7 +6540,7 @@ nsWindow::SetDrawsInTitlebar(bool aState) return; if (mShell) { - if (GetCSDSupportLevel() == CSD_SUPPORT_FULL) { + if (GetCSDSupportLevel() == CSD_SUPPORT_SYSTEM) { SetWindowDecoration(aState ? eBorderStyle_border : mBorderStyle); } else { @@ -6887,59 +6887,59 @@ nsWindow::GetCSDSupportLevel() { if (currentDesktop) { // GNOME Flashback (fallback) if (strstr(currentDesktop, "GNOME-Flashback:GNOME") != nullptr) { - sCSDSupportLevel = CSD_SUPPORT_FLAT; + sCSDSupportLevel = CSD_SUPPORT_CLIENT; // gnome-shell } else if (strstr(currentDesktop, "GNOME") != nullptr) { - sCSDSupportLevel = CSD_SUPPORT_FULL; + sCSDSupportLevel = CSD_SUPPORT_SYSTEM; } else if (strstr(currentDesktop, "XFCE") != nullptr) { - sCSDSupportLevel = CSD_SUPPORT_FLAT; + sCSDSupportLevel = CSD_SUPPORT_CLIENT; } else if (strstr(currentDesktop, "X-Cinnamon") != nullptr) { - sCSDSupportLevel = CSD_SUPPORT_FULL; + sCSDSupportLevel = CSD_SUPPORT_SYSTEM; // KDE Plasma } else if (strstr(currentDesktop, "KDE") != nullptr) { - sCSDSupportLevel = CSD_SUPPORT_FLAT; + sCSDSupportLevel = CSD_SUPPORT_CLIENT; } else if (strstr(currentDesktop, "LXDE") != nullptr) { - sCSDSupportLevel = CSD_SUPPORT_FLAT; + sCSDSupportLevel = CSD_SUPPORT_CLIENT; } else if (strstr(currentDesktop, "openbox") != nullptr) { - sCSDSupportLevel = CSD_SUPPORT_FLAT; + sCSDSupportLevel = CSD_SUPPORT_CLIENT; } else if (strstr(currentDesktop, "i3") != nullptr) { sCSDSupportLevel = CSD_SUPPORT_NONE; } else if (strstr(currentDesktop, "MATE") != nullptr) { - sCSDSupportLevel = CSD_SUPPORT_FLAT; + sCSDSupportLevel = CSD_SUPPORT_CLIENT; // Ubuntu Unity } else if (strstr(currentDesktop, "Unity") != nullptr) { - sCSDSupportLevel = CSD_SUPPORT_FLAT; + sCSDSupportLevel = CSD_SUPPORT_CLIENT; // Elementary OS } else if (strstr(currentDesktop, "Pantheon") != nullptr) { - sCSDSupportLevel = CSD_SUPPORT_FULL; + sCSDSupportLevel = CSD_SUPPORT_SYSTEM; } else if (strstr(currentDesktop, "LXQt") != nullptr) { - sCSDSupportLevel = CSD_SUPPORT_FULL; + sCSDSupportLevel = CSD_SUPPORT_SYSTEM; } else { // Release or beta builds are not supposed to be broken // so disable titlebar rendering on untested/unknown systems. #if defined(RELEASE_OR_BETA) sCSDSupportLevel = CSD_SUPPORT_NONE; #else - sCSDSupportLevel = CSD_SUPPORT_FLAT; + sCSDSupportLevel = CSD_SUPPORT_CLIENT; #endif } } else { sCSDSupportLevel = CSD_SUPPORT_NONE; } - // We don't support CSD_SUPPORT_FULL on Wayland + // We don't support CSD_SUPPORT_SYSTEM on Wayland if (!GDK_IS_X11_DISPLAY(gdk_display_get_default()) && - sCSDSupportLevel == CSD_SUPPORT_FULL) { - sCSDSupportLevel = CSD_SUPPORT_FLAT; + sCSDSupportLevel == CSD_SUPPORT_SYSTEM) { + sCSDSupportLevel = CSD_SUPPORT_CLIENT; } // GTK_CSD forces CSD mode - use also CSD because window manager // decorations does not work with CSD. // We check GTK_CSD as well as gtk_window_should_use_csd() does. - if (sCSDSupportLevel == CSD_SUPPORT_FULL) { + if (sCSDSupportLevel == CSD_SUPPORT_SYSTEM) { const char* csdOverride = getenv("GTK_CSD"); if (csdOverride && g_strcmp0(csdOverride, "1") == 0) { - sCSDSupportLevel = CSD_SUPPORT_FLAT; + sCSDSupportLevel = CSD_SUPPORT_CLIENT; } } @@ -6949,9 +6949,9 @@ nsWindow::GetCSDSupportLevel() { if (strcmp(decorationOverride, "none") == 0) { sCSDSupportLevel = CSD_SUPPORT_NONE; } else if (strcmp(decorationOverride, "client") == 0) { - sCSDSupportLevel = CSD_SUPPORT_FLAT; + sCSDSupportLevel = CSD_SUPPORT_CLIENT; } else if (strcmp(decorationOverride, "system") == 0) { - sCSDSupportLevel = CSD_SUPPORT_FULL; + sCSDSupportLevel = CSD_SUPPORT_SYSTEM; } } diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h index fd68a3ad3fee..1fda5fa1c3f1 100644 --- a/widget/gtk/nsWindow.h +++ b/widget/gtk/nsWindow.h @@ -376,9 +376,9 @@ public: bool DoDrawTitlebar() const; - typedef enum { CSD_SUPPORT_FULL, // CSD including shadows - CSD_SUPPORT_FLAT, // CSD without shadows - CSD_SUPPORT_NONE, // WM does not support CSD at all + typedef enum { CSD_SUPPORT_SYSTEM, // CSD including shadows + CSD_SUPPORT_CLIENT, // CSD without shadows + CSD_SUPPORT_NONE, // WM does not support CSD at all CSD_SUPPORT_UNKNOWN } CSDSupportLevel; /**