Enable hidden system titlebar by default on Gnome.

This patch implements -moz-gtk-csd-hide-titlebar-by-default media query
to check if the system titlebar should be disabled by default on Linux systems
(it's already disabled on Window/Mac).

It also removes explicit definition of browser.tabs.drawInTitlebar preference on Linux.
When browser.tabs.drawInTitlebar is missing the -moz-gtk-csd-hide-titlebar-by-default
is used to obtain the titlebar state. When browser.tabs.drawInTitlebar is set
in about:config or by Customize menu, the user peference is used instead of the default.

It also fixes a -moz-gtk-csd-available media query,
it was always true regardless the actual system setting.

Differential Revision: https://phabricator.services.mozilla.com/D16036
This commit is contained in:
Martin Stransky 2019-01-17 12:44:49 +00:00 committed by Emilio Cobos Álvarez
parent 1ae815214a
commit 424eb94c7f

View file

@ -526,7 +526,7 @@ lazy_static! {
/// to support new types in these entries and (2) ensuring that either /// to support new types in these entries and (2) ensuring that either
/// nsPresContext::MediaFeatureValuesChanged is called when the value that /// nsPresContext::MediaFeatureValuesChanged is called when the value that
/// would be returned by the evaluator function could change. /// would be returned by the evaluator function could change.
pub static ref MEDIA_FEATURES: [MediaFeatureDescription; 50] = [ pub static ref MEDIA_FEATURES: [MediaFeatureDescription; 51] = [
feature!( feature!(
atom!("width"), atom!("width"),
AllowsRanges::Yes, AllowsRanges::Yes,
@ -719,6 +719,7 @@ lazy_static! {
system_metric_feature!(atom!("-moz-menubar-drag")), system_metric_feature!(atom!("-moz-menubar-drag")),
system_metric_feature!(atom!("-moz-swipe-animation-enabled")), system_metric_feature!(atom!("-moz-swipe-animation-enabled")),
system_metric_feature!(atom!("-moz-gtk-csd-available")), system_metric_feature!(atom!("-moz-gtk-csd-available")),
system_metric_feature!(atom!("-moz-gtk-csd-hide-titlebar-by-default")),
system_metric_feature!(atom!("-moz-gtk-csd-transparent-background")), system_metric_feature!(atom!("-moz-gtk-csd-transparent-background")),
system_metric_feature!(atom!("-moz-gtk-csd-minimize-button")), system_metric_feature!(atom!("-moz-gtk-csd-minimize-button")),
system_metric_feature!(atom!("-moz-gtk-csd-maximize-button")), system_metric_feature!(atom!("-moz-gtk-csd-maximize-button")),