From 4413f816e6016e3759e7e0b2d8188ee62aa1ab6a Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Tue, 20 Aug 2013 00:48:56 +0200 Subject: [PATCH] Background: allow passing the settings schema from outside This way it is possible to use different settings for different backgrounds. https://bugzilla.gnome.org/show_bug.cgi?id=688210 --- js/ui/background.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/js/ui/background.js b/js/ui/background.js index 1d9ab7c21..246060a88 100644 --- a/js/ui/background.js +++ b/js/ui/background.js @@ -295,14 +295,15 @@ const Background = new Lang.Class({ _init: function(params) { params = Params.parse(params, { monitorIndex: 0, layoutManager: Main.layoutManager, - effects: Meta.BackgroundEffects.NONE }); + effects: Meta.BackgroundEffects.NONE, + settings: null }); this.actor = new Meta.BackgroundGroup(); this.actor._delegate = this; this._destroySignalId = this.actor.connect('destroy', Lang.bind(this, this._destroy)); - this._settings = new Gio.Settings({ schema: BACKGROUND_SCHEMA }); + this._settings = params.settings; this._monitorIndex = params.monitorIndex; this._layoutManager = params.layoutManager; this._effects = params.effects; @@ -716,8 +717,10 @@ const BackgroundManager = new Lang.Class({ layoutManager: Main.layoutManager, monitorIndex: null, effects: Meta.BackgroundEffects.NONE, - controlPosition: true }); + controlPosition: true, + settingsSchema: BACKGROUND_SCHEMA }); + this._settings = new Gio.Settings({ schema: params.settingsSchema }); this._container = params.container; this._layoutManager = params.layoutManager; this._effects = params.effects; @@ -776,7 +779,8 @@ const BackgroundManager = new Lang.Class({ _createBackground: function() { let background = new Background({ monitorIndex: this._monitorIndex, layoutManager: this._layoutManager, - effects: this._effects }); + effects: this._effects, + settings: this._settings }); this._container.add_child(background.actor); let monitor = this._layoutManager.monitors[this._monitorIndex];