Bug 1736518 - Make browser.tabs.drawInTitlebar a tri-state. r=stransky,Gijs

To more properly support Linux having a different default at runtime.

Expose the resolved value in appinfo for convenience, and use it in the
front-end as needed.

Differential Revision: https://phabricator.services.mozilla.com/D129004
This commit is contained in:
Emilio Cobos Álvarez
2021-10-21 09:07:12 +00:00
parent c6cd2d6005
commit d37eb95bc7
26 changed files with 112 additions and 104 deletions

View File

@@ -8720,29 +8720,6 @@ bool nsWindow::TitlebarUseShapeMask() {
return useShapeMask;
}
bool nsWindow::HideTitlebarByDefault() {
static int hideTitlebar = []() {
// 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.
const char* currentDesktop = getenv("XDG_CURRENT_DESKTOP");
if (!currentDesktop ||
GetSystemGtkWindowDecoration() == GTK_DECORATION_NONE) {
return false;
}
// We hide system titlebar on Gnome/ElementaryOS without any restriction.
return ((strstr(currentDesktop, "GNOME-Flashback:GNOME") != nullptr ||
strstr(currentDesktop, "GNOME") != nullptr ||
strstr(currentDesktop, "Pantheon") != nullptr));
}();
return hideTitlebar;
}
int32_t nsWindow::RoundsWidgetCoordinatesTo() { return GdkCeiledScaleFactor(); }
void nsWindow::GetCompositorWidgetInitData(