Bug 1549537 - Unconditionally offer 'Span' option for desktop background position on Linux. r=sfoster

Bug 1544105 added a default implementation of `GfxInfoBase::FindMonitors` so
`gfxInfo.getMonitors()` no longer throws on Linux, but it only ever returns the
primary monitor there.

Differential Revision: https://phabricator.services.mozilla.com/D30096

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Ian Moody 2019-05-07 18:36:19 +00:00
parent 566d9090f7
commit 8b8cafe43c

View File

@ -33,13 +33,14 @@ var gSetBackground = {
document.documentElement.getButton("accept").hidden = true;
} else {
let multiMonitors = false;
try {
if (AppConstants.platform == "linux") {
// getMonitors only ever returns the primary monitor on Linux, so just
// always show the option
multiMonitors = true;
} else {
const gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
const monitors = gfxInfo.getMonitors();
multiMonitors = monitors.length > 1;
} catch (e) {
// getMonitors() isn't implemented on Linux
multiMonitors = true;
}
if (!multiMonitors || AppConstants.isPlatformAndVersionAtMost("win", 6.1)) {