background: Add option to not use background content size

Will be used by next commit to draw workspaces at a different size of the
background itself.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1599>
This commit is contained in:
Georges Basile Stavracas Neto 2020-06-09 18:18:21 -03:00 committed by Marge Bot
parent 862b5be7a2
commit cfc1f1fd9c

View File

@ -662,6 +662,7 @@ var BackgroundManager = class BackgroundManager {
vignette: false, vignette: false,
controlPosition: true, controlPosition: true,
settingsSchema: BACKGROUND_SCHEMA, settingsSchema: BACKGROUND_SCHEMA,
useContentSize: true,
}); });
let cache = getBackgroundCache(); let cache = getBackgroundCache();
@ -673,6 +674,7 @@ var BackgroundManager = class BackgroundManager {
this._vignette = params.vignette; this._vignette = params.vignette;
this._monitorIndex = params.monitorIndex; this._monitorIndex = params.monitorIndex;
this._controlPosition = params.controlPosition; this._controlPosition = params.controlPosition;
this._useContentSize = params.useContentSize;
this.backgroundActor = this._createBackgroundActor(); this.backgroundActor = this._createBackgroundActor();
this._newBackgroundActor = null; this._newBackgroundActor = null;
@ -747,6 +749,11 @@ var BackgroundManager = class BackgroundManager {
let backgroundActor = new Meta.BackgroundActor({ let backgroundActor = new Meta.BackgroundActor({
meta_display: global.display, meta_display: global.display,
monitor: this._monitorIndex, monitor: this._monitorIndex,
request_mode: this._useContentSize
? Clutter.RequestMode.CONTENT_SIZE
: Clutter.RequestMode.HEIGHT_FOR_WIDTH,
x_expand: !this._useContentSize,
y_expand: !this._useContentSize,
}); });
backgroundActor.content.set({ backgroundActor.content.set({
background, background,