From b0e22a795e59de752be885e5839110a499d86156 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Mon, 17 Dec 2012 19:31:45 +0100 Subject: [PATCH] Adapt for MetaBackgroundActor API changes MetaBackgroundActor can now be constructed as a standard GObject, and accepts a GnomeBG settings object, which we retrieve from the default one to share textures. https://bugzilla.gnome.org/show_bug.cgi?id=688210 --- js/ui/main.js | 4 ++++ js/ui/overview.js | 3 ++- js/ui/screenShield.js | 3 ++- js/ui/workspaceThumbnail.js | 3 ++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/js/ui/main.js b/js/ui/main.js index 7d7d06323..c7e65ee34 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -63,6 +63,7 @@ let magnifier = null; let xdndHandler = null; let keyboard = null; let layoutManager = null; +let background = null; let _startDate; let _defaultCssStylesheet = null; let _cssStylesheet = null; @@ -142,6 +143,9 @@ function start() { global.overlay_group.reparent(uiGroup); global.stage.add_actor(uiGroup); + let backgroundActor = global.window_group.background; + background = backgroundActor.settings; + layoutManager = new Layout.LayoutManager(); xdndHandler = new XdndHandler.XdndHandler(); ctrlAltTabManager = new CtrlAltTab.CtrlAltTabManager(); diff --git a/js/ui/overview.js b/js/ui/overview.js index a8f7e4abf..b81d226d3 100644 --- a/js/ui/overview.js +++ b/js/ui/overview.js @@ -122,7 +122,8 @@ const Overview = new Lang.Class({ // one. Instances of this class share a single CoglTexture behind the // scenes which allows us to show the background with different // rendering options without duplicating the texture data. - this._background = Meta.BackgroundActor.new_for_screen(global.screen); + this._background = new Meta.BackgroundActor({ screen: global.screen, + settings: Main.background }); this._background.add_glsl_snippet(Meta.SnippetHook.FRAGMENT, GLSL_DIM_EFFECT_DECLARATIONS, GLSL_DIM_EFFECT_CODE, diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js index 7c2729e61..91532b9a5 100644 --- a/js/ui/screenShield.js +++ b/js/ui/screenShield.js @@ -467,7 +467,8 @@ const ScreenShield = new Lang.Class({ name: 'lockScreenContents' }); this._lockScreenContents.add_constraint(new Layout.MonitorConstraint({ primary: true })); - let backgroundActor = Meta.BackgroundActor.new_for_screen(global.screen); + let backgroundActor = new Meta.BackgroundActor({ screen: global.screen, + settings: Main.background }); backgroundActor.add_glsl_snippet(Meta.SnippetHook.TEXTURE_LOOKUP, GLSL_BLUR_EFFECT_DECLARATIONS, GLSL_BLUR_EFFECT_CODE, diff --git a/js/ui/workspaceThumbnail.js b/js/ui/workspaceThumbnail.js index fd68ce583..ecdb24d82 100644 --- a/js/ui/workspaceThumbnail.js +++ b/js/ui/workspaceThumbnail.js @@ -170,7 +170,8 @@ const WorkspaceThumbnail = new Lang.Class({ this.actor.connect('destroy', Lang.bind(this, this._onDestroy)); - this._background = Meta.BackgroundActor.new_for_screen(global.screen); + this._background = new Meta.BackgroundActor({ screen: global.screen, + settings: Main.background }); this._contents.add_actor(this._background); let monitor = Main.layoutManager.primaryMonitor;