Bug 1812289 - Enable CSD titlebar more by default. r=stransky

It works well on KDE and others, so try to enable it unconditionally for
consistency, specially given stuff like the native titlebar context menu
etc works (bug 1771950).

Now that the titlebar setting is a tri-state, the hidden pref doesn't
make particular sense either, browser.tabs.inTitlebar=1 would have the
same effect.

Differential Revision: https://phabricator.services.mozilla.com/D167796
This commit is contained in:
Emilio Cobos Álvarez 2023-01-25 16:52:59 +00:00
parent 91357fa690
commit c997602a07

View file

@ -2075,25 +2075,7 @@ char16_t nsLookAndFeel::GetPasswordCharacterImpl() {
bool nsLookAndFeel::GetEchoPasswordImpl() { return false; }
bool nsLookAndFeel::GetDefaultDrawInTitlebar() {
static bool drawInTitlebar = []() {
// When user defined widget.default-hidden-titlebar don't do any
// heuristics and just follow it.
if (Preferences::HasUserValue("widget.default-hidden-titlebar")) {
return Preferences::GetBool("widget.default-hidden-titlebar", false);
}
// Don't hide titlebar when it's disabled on current desktop.
if (!sCSDAvailable) {
return false;
}
// We hide system titlebar on Gnome/ElementaryOS without any restriction.
return IsGnomeDesktopEnvironment() ||
FindInReadable("pantheon"_ns, GetDesktopEnvironmentIdentifier());
}();
return drawInTitlebar;
}
bool nsLookAndFeel::GetDefaultDrawInTitlebar() { return sCSDAvailable; }
void nsLookAndFeel::GetThemeInfo(nsACString& aInfo) {
aInfo.Append(mSystemTheme.mName);