From 0ccbb31d06f78a0b93d04d2eec2f2346be353f87 Mon Sep 17 00:00:00 2001 From: Simon Schneegans Date: Sat, 9 Sep 2023 06:17:58 +0200 Subject: [PATCH] :recycle: Use more dynamic imports --- docs/how-to-create-new-effects.md | 3 +++ src/effects/Apparition.js | 3 +++ src/effects/BrokenGlass.js | 10 ++++++---- src/effects/Doom.js | 3 +++ src/effects/EnergizeA.js | 9 ++++----- src/effects/EnergizeB.js | 9 ++++----- src/effects/Fire.js | 9 ++++----- src/effects/Glide.js | 3 +++ src/effects/Glitch.js | 9 ++++----- src/effects/Hexagon.js | 9 ++++----- src/effects/Incinerate.js | 8 ++++---- src/effects/Matrix.js | 10 ++++++---- src/effects/PaintBrush.js | 10 ++++++---- src/effects/PixelWheel.js | 3 +++ src/effects/PixelWipe.js | 3 +++ src/effects/Pixelate.js | 3 +++ src/effects/Portal.js | 9 ++++----- src/effects/SnapOfDisintegration.js | 10 ++++++---- src/effects/TRexAttack.js | 10 ++++++---- src/effects/TVEffect.js | 9 ++++----- src/effects/TVGlitch.js | 9 ++++----- src/effects/Wisps.js | 9 ++++----- 22 files changed, 91 insertions(+), 69 deletions(-) diff --git a/docs/how-to-create-new-effects.md b/docs/how-to-create-new-effects.md index 035e4cb..606cb2d 100644 --- a/docs/how-to-create-new-effects.md +++ b/docs/how-to-create-new-effects.md @@ -169,6 +169,9 @@ const _ = imports.gettext.domain("burn-my-windows").gettext; import * as utils from "../utils.js"; +// We import the ShaderFactory only in the Shell process as it is not required in the +// preferences process. The preferences process does not create any shader instances, it +// only uses the static metadata of the effect. const ShaderFactory = await utils.importInShellOnly("./ShaderFactory.js"); ////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/effects/Apparition.js b/src/effects/Apparition.js index 9d5ea21..46665f6 100644 --- a/src/effects/Apparition.js +++ b/src/effects/Apparition.js @@ -18,6 +18,9 @@ const _ = imports.gettext.domain('burn-my-windows').gettext; import * as utils from '../utils.js'; +// We import the ShaderFactory only in the Shell process as it is not required in the +// preferences process. The preferences process does not create any shader instances, it +// only uses the static metadata of the effect. const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js'); ////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/effects/BrokenGlass.js b/src/effects/BrokenGlass.js index 7b2928c..7239294 100644 --- a/src/effects/BrokenGlass.js +++ b/src/effects/BrokenGlass.js @@ -18,7 +18,13 @@ const _ = imports.gettext.domain('burn-my-windows').gettext; import * as utils from '../utils.js'; +// We import some modules only in the Shell process as they are not available in the +// preferences process. They are used only in the creator function of the ShaderFactory +// which is only called within GNOME Shell's process. const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js'); +const Clutter = await utils.importInShellOnly('gi://Clutter'); +const GdkPixbuf = await utils.importInShellOnly('gi://GdkPixbuf'); +const Cogl = await utils.importInShellOnly('gi://Cogl'); ////////////////////////////////////////////////////////////////////////////////////////// // This effect shatters the window into pieces. For an explanation how this works, look // @@ -47,10 +53,6 @@ export default class Effect { // newly created shader instance. constructor() { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => { - // We import these modules in this function as they are not available in the - // preferences process. This callback is only called within GNOME Shell's process. - const {Clutter, GdkPixbuf, Cogl} = imports.gi; - // Create the texture in the first call. if (!this._shardTexture) { const shardData = GdkPixbuf.Pixbuf.new_from_resource('/img/shards.png'); diff --git a/src/effects/Doom.js b/src/effects/Doom.js index 2847cc7..7a782d5 100644 --- a/src/effects/Doom.js +++ b/src/effects/Doom.js @@ -18,6 +18,9 @@ const _ = imports.gettext.domain('burn-my-windows').gettext; import * as utils from '../utils.js'; +// We import the ShaderFactory only in the Shell process as it is not required in the +// preferences process. The preferences process does not create any shader instances, it +// only uses the static metadata of the effect. const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js'); ////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/effects/EnergizeA.js b/src/effects/EnergizeA.js index 3d91a01..6476b3e 100644 --- a/src/effects/EnergizeA.js +++ b/src/effects/EnergizeA.js @@ -18,7 +18,11 @@ const _ = imports.gettext.domain('burn-my-windows').gettext; import * as utils from '../utils.js'; +// We import some modules only in the Shell process as they are not available in the +// preferences process. They are used only in the creator function of the ShaderFactory +// which is only called within GNOME Shell's process. const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js'); +const Clutter = await utils.importInShellOnly('gi://Clutter'); ////////////////////////////////////////////////////////////////////////////////////////// // This effect looks a bit like the transporter effect from TOS. // @@ -35,11 +39,6 @@ export default class Effect { // newly created shader instance. constructor() { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => { - // We import Clutter in this function as it is not available in the preferences - // process. This creator function of the ShaderFactory is only called within GNOME - // Shell's process. - const Clutter = imports.gi.Clutter; - // Store uniform locations of newly created shaders. shader._uColor = shader.get_uniform_location('uColor'); shader._uScale = shader.get_uniform_location('uScale'); diff --git a/src/effects/EnergizeB.js b/src/effects/EnergizeB.js index 6a2354d..d2649e9 100644 --- a/src/effects/EnergizeB.js +++ b/src/effects/EnergizeB.js @@ -18,7 +18,11 @@ const _ = imports.gettext.domain('burn-my-windows').gettext; import * as utils from '../utils.js'; +// We import some modules only in the Shell process as they are not available in the +// preferences process. They are used only in the creator function of the ShaderFactory +// which is only called within GNOME Shell's process. const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js'); +const Clutter = await utils.importInShellOnly('gi://Clutter'); ////////////////////////////////////////////////////////////////////////////////////////// // This effect looks a bit like the transporter effect from TNG. // @@ -35,11 +39,6 @@ export default class Effect { // newly created shader instance. constructor() { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => { - // We import Clutter in this function as it is not available in the preferences - // process. This creator function of the ShaderFactory is only called within GNOME - // Shell's process. - const Clutter = imports.gi.Clutter; - // Store uniform locations of newly created shaders. shader._uColor = shader.get_uniform_location('uColor'); shader._uScale = shader.get_uniform_location('uScale'); diff --git a/src/effects/Fire.js b/src/effects/Fire.js index d6b3720..34d1771 100644 --- a/src/effects/Fire.js +++ b/src/effects/Fire.js @@ -20,7 +20,11 @@ const _ = imports.gettext.domain('burn-my-windows').gettext; import * as utils from '../utils.js'; +// We import some modules only in the Shell process as they are not available in the +// preferences process. They are used only in the creator function of the ShaderFactory +// which is only called within GNOME Shell's process. const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js'); +const Clutter = await utils.importInShellOnly('gi://Clutter'); ////////////////////////////////////////////////////////////////////////////////////////// // This effect is a homage to the good old Compiz days. However, it is implemented // @@ -41,11 +45,6 @@ export default class Effect { // newly created shader instance. constructor() { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => { - // We import Clutter in this function as it is not available in the preferences - // process. This creator function of the ShaderFactory is only called within GNOME - // Shell's process. - const Clutter = imports.gi.Clutter; - // Store all uniform locations. shader._uGradient = [ shader.get_uniform_location('uGradient1'), diff --git a/src/effects/Glide.js b/src/effects/Glide.js index 2c0c606..a567808 100644 --- a/src/effects/Glide.js +++ b/src/effects/Glide.js @@ -18,6 +18,9 @@ const _ = imports.gettext.domain('burn-my-windows').gettext; import * as utils from '../utils.js'; +// We import the ShaderFactory only in the Shell process as it is not required in the +// preferences process. The preferences process does not create any shader instances, it +// only uses the static metadata of the effect. const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js'); ////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/effects/Glitch.js b/src/effects/Glitch.js index 3483b51..8e675ea 100644 --- a/src/effects/Glitch.js +++ b/src/effects/Glitch.js @@ -18,7 +18,11 @@ const _ = imports.gettext.domain('burn-my-windows').gettext; import * as utils from '../utils.js'; +// We import some modules only in the Shell process as they are not available in the +// preferences process. They are used only in the creator function of the ShaderFactory +// which is only called within GNOME Shell's process. const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js'); +const Clutter = await utils.importInShellOnly('gi://Clutter'); ////////////////////////////////////////////////////////////////////////////////////////// // This effect applies some intentional graphics issues to your windows. // @@ -35,11 +39,6 @@ export default class Effect { // newly created shader instance. constructor() { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => { - // We import Clutter in this function as it is not available in the preferences - // process. This creator function of the ShaderFactory is only called within GNOME - // Shell's process. - const Clutter = imports.gi.Clutter; - // Store uniform locations of newly created shaders. shader._uSeed = shader.get_uniform_location('uSeed'); shader._uColor = shader.get_uniform_location('uColor'); diff --git a/src/effects/Hexagon.js b/src/effects/Hexagon.js index 9cc3c2b..ac39669 100644 --- a/src/effects/Hexagon.js +++ b/src/effects/Hexagon.js @@ -18,7 +18,11 @@ const _ = imports.gettext.domain('burn-my-windows').gettext; import * as utils from '../utils.js'; +// We import some modules only in the Shell process as they are not available in the +// preferences process. They are used only in the creator function of the ShaderFactory +// which is only called within GNOME Shell's process. const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js'); +const Clutter = await utils.importInShellOnly('gi://Clutter'); ////////////////////////////////////////////////////////////////////////////////////////// // This effect overlays a glowing hexagonal grid over the window. The grid cells then // @@ -36,11 +40,6 @@ export default class Effect { // newly created shader instance. constructor() { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => { - // We import Clutter in this function as it is not available in the preferences - // process. This creator function of the ShaderFactory is only called within GNOME - // Shell's process. - const Clutter = imports.gi.Clutter; - // Store uniform locations of newly created shaders. shader._uAdditiveBlending = shader.get_uniform_location('uAdditiveBlending'); shader._uSeed = shader.get_uniform_location('uSeed'); diff --git a/src/effects/Incinerate.js b/src/effects/Incinerate.js index 8fbffeb..cb52e8c 100644 --- a/src/effects/Incinerate.js +++ b/src/effects/Incinerate.js @@ -18,7 +18,11 @@ const _ = imports.gettext.domain('burn-my-windows').gettext; import * as utils from '../utils.js'; +// We import some modules only in the Shell process as they are not available in the +// preferences process. They are used only in the creator function of the ShaderFactory +// which is only called within GNOME Shell's process. const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js'); +const Clutter = await utils.importInShellOnly('gi://Clutter'); ////////////////////////////////////////////////////////////////////////////////////////// // This effect burns windows to ashes. The fire starts at a random position at the // @@ -36,10 +40,6 @@ export default class Effect { // newly created shader instance. constructor() { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => { - // We import these modules in this function as they are not available in the - // preferences process. This callback is only called within GNOME Shell's process. - const {Clutter} = imports.gi; - // Store uniform locations of newly created shaders. shader._uSeed = shader.get_uniform_location('uSeed'); shader._uColor = shader.get_uniform_location('uColor'); diff --git a/src/effects/Matrix.js b/src/effects/Matrix.js index 9a683e8..f8f2559 100644 --- a/src/effects/Matrix.js +++ b/src/effects/Matrix.js @@ -18,7 +18,13 @@ const _ = imports.gettext.domain('burn-my-windows').gettext; import * as utils from '../utils.js'; +// We import some modules only in the Shell process as they are not available in the +// preferences process. They are used only in the creator function of the ShaderFactory +// which is only called within GNOME Shell's process. const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js'); +const Clutter = await utils.importInShellOnly('gi://Clutter'); +const GdkPixbuf = await utils.importInShellOnly('gi://GdkPixbuf'); +const Cogl = await utils.importInShellOnly('gi://Cogl'); ////////////////////////////////////////////////////////////////////////////////////////// // The Matrix shader multiplies a grid of random letters with some gradients which are // @@ -39,10 +45,6 @@ export default class Effect { // newly created shader instance. constructor() { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => { - // We import these modules in this function as they are not available in the - // preferences process. This callback is only called within GNOME Shell's process. - const {Clutter, GdkPixbuf, Cogl} = imports.gi; - // Create the texture in the first call. if (!this._fontTexture) { const fontData = GdkPixbuf.Pixbuf.new_from_resource('/img/matrixFont.png'); diff --git a/src/effects/PaintBrush.js b/src/effects/PaintBrush.js index 59a6e49..5d0d1ec 100644 --- a/src/effects/PaintBrush.js +++ b/src/effects/PaintBrush.js @@ -18,7 +18,13 @@ const _ = imports.gettext.domain('burn-my-windows').gettext; import * as utils from '../utils.js'; +// We import some modules only in the Shell process as they are not available in the +// preferences process. They are used only in the creator function of the ShaderFactory +// which is only called within GNOME Shell's process. const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js'); +const Clutter = await utils.importInShellOnly('gi://Clutter'); +const GdkPixbuf = await utils.importInShellOnly('gi://GdkPixbuf'); +const Cogl = await utils.importInShellOnly('gi://Cogl'); ////////////////////////////////////////////////////////////////////////////////////////// // This effect paints your windows with a thick paint brush. // @@ -37,10 +43,6 @@ export default class Effect { // newly created shader instance. constructor() { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => { - // We import these modules in this function as they are not available in the - // preferences process. This callback is only called within GNOME Shell's process. - const {Clutter, GdkPixbuf, Cogl} = imports.gi; - // Create the texture in the first call. if (!this._brushTexture) { const brushData = GdkPixbuf.Pixbuf.new_from_resource('/img/brush.png'); diff --git a/src/effects/PixelWheel.js b/src/effects/PixelWheel.js index 06d0b05..72352fa 100644 --- a/src/effects/PixelWheel.js +++ b/src/effects/PixelWheel.js @@ -18,6 +18,9 @@ const _ = imports.gettext.domain('burn-my-windows').gettext; import * as utils from '../utils.js'; +// We import the ShaderFactory only in the Shell process as it is not required in the +// preferences process. The preferences process does not create any shader instances, it +// only uses the static metadata of the effect. const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js'); ////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/effects/PixelWipe.js b/src/effects/PixelWipe.js index 50077e2..057af94 100644 --- a/src/effects/PixelWipe.js +++ b/src/effects/PixelWipe.js @@ -18,6 +18,9 @@ const _ = imports.gettext.domain('burn-my-windows').gettext; import * as utils from '../utils.js'; +// We import the ShaderFactory only in the Shell process as it is not required in the +// preferences process. The preferences process does not create any shader instances, it +// only uses the static metadata of the effect. const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js'); ////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/effects/Pixelate.js b/src/effects/Pixelate.js index dee05c2..406ad23 100644 --- a/src/effects/Pixelate.js +++ b/src/effects/Pixelate.js @@ -18,6 +18,9 @@ const _ = imports.gettext.domain('burn-my-windows').gettext; import * as utils from '../utils.js'; +// We import the ShaderFactory only in the Shell process as it is not required in the +// preferences process. The preferences process does not create any shader instances, it +// only uses the static metadata of the effect. const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js'); ////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/effects/Portal.js b/src/effects/Portal.js index 5e9d3ce..48a8e58 100644 --- a/src/effects/Portal.js +++ b/src/effects/Portal.js @@ -18,7 +18,11 @@ const _ = imports.gettext.domain('burn-my-windows').gettext; import * as utils from '../utils.js'; +// We import some modules only in the Shell process as they are not available in the +// preferences process. They are used only in the creator function of the ShaderFactory +// which is only called within GNOME Shell's process. const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js'); +const Clutter = await utils.importInShellOnly('gi://Clutter'); ////////////////////////////////////////////////////////////////////////////////////////// // This ridiculous effect teleports your windows from and to alternative dimensions. // @@ -36,11 +40,6 @@ export default class Effect { // newly created shader instance. constructor() { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => { - // We import Clutter in this function as it is not available in the preferences - // process. This creator function of the ShaderFactory is only called within GNOME - // Shell's process. - const Clutter = imports.gi.Clutter; - // Store uniform locations of newly created shaders. shader._uSeed = shader.get_uniform_location('uSeed'); shader._uColor = shader.get_uniform_location('uColor'); diff --git a/src/effects/SnapOfDisintegration.js b/src/effects/SnapOfDisintegration.js index 6e7002f..f8f595d 100644 --- a/src/effects/SnapOfDisintegration.js +++ b/src/effects/SnapOfDisintegration.js @@ -18,7 +18,13 @@ const _ = imports.gettext.domain('burn-my-windows').gettext; import * as utils from '../utils.js'; +// We import some modules only in the Shell process as they are not available in the +// preferences process. They are used only in the creator function of the ShaderFactory +// which is only called within GNOME Shell's process. const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js'); +const Clutter = await utils.importInShellOnly('gi://Clutter'); +const GdkPixbuf = await utils.importInShellOnly('gi://GdkPixbuf'); +const Cogl = await utils.importInShellOnly('gi://Cogl'); ////////////////////////////////////////////////////////////////////////////////////////// // This effects dissolves your windows into a cloud of dust. For this, it uses an // @@ -41,10 +47,6 @@ export default class Effect { // newly created shader instance. constructor() { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => { - // We import these modules in this function as they are not available in the - // preferences process. This callback is only called within GNOME Shell's process. - const {Clutter, GdkPixbuf, Cogl} = imports.gi; - // Create the texture in the first call. if (!this._dustTexture) { const dustData = GdkPixbuf.Pixbuf.new_from_resource('/img/dust.png'); diff --git a/src/effects/TRexAttack.js b/src/effects/TRexAttack.js index 1e8cfd0..aa94a9f 100644 --- a/src/effects/TRexAttack.js +++ b/src/effects/TRexAttack.js @@ -18,7 +18,13 @@ const _ = imports.gettext.domain('burn-my-windows').gettext; import * as utils from '../utils.js'; +// We import some modules only in the Shell process as they are not available in the +// preferences process. They are used only in the creator function of the ShaderFactory +// which is only called within GNOME Shell's process. const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js'); +const Clutter = await utils.importInShellOnly('gi://Clutter'); +const GdkPixbuf = await utils.importInShellOnly('gi://GdkPixbuf'); +const Cogl = await utils.importInShellOnly('gi://Cogl'); ////////////////////////////////////////////////////////////////////////////////////////// // This effect tears your windows apart with a series of violent scratches! // @@ -37,10 +43,6 @@ export default class Effect { // newly created shader instance. constructor() { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => { - // We import these modules in this function as they are not available in the - // preferences process. This callback is only called within GNOME Shell's process. - const {Clutter, GdkPixbuf, Cogl} = imports.gi; - // Create the texture in the first call. if (!this._clawTexture) { const clawData = GdkPixbuf.Pixbuf.new_from_resource('/img/claws.png'); diff --git a/src/effects/TVEffect.js b/src/effects/TVEffect.js index 713ea15..5dd2eae 100644 --- a/src/effects/TVEffect.js +++ b/src/effects/TVEffect.js @@ -18,7 +18,11 @@ const _ = imports.gettext.domain('burn-my-windows').gettext; import * as utils from '../utils.js'; +// We import some modules only in the Shell process as they are not available in the +// preferences process. They are used only in the creator function of the ShaderFactory +// which is only called within GNOME Shell's process. const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js'); +const Clutter = await utils.importInShellOnly('gi://Clutter'); ////////////////////////////////////////////////////////////////////////////////////////// // This effect hides the actor by making it first transparent from top and bottom // @@ -37,11 +41,6 @@ export default class Effect { // newly created shader instance. constructor() { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => { - // We import Clutter in this function as it is not available in the preferences - // process. This creator function of the ShaderFactory is only called within GNOME - // Shell's process. - const Clutter = imports.gi.Clutter; - // Store uniform locations of newly created shaders. shader._uColor = shader.get_uniform_location('uColor'); diff --git a/src/effects/TVGlitch.js b/src/effects/TVGlitch.js index 083be22..7082d31 100644 --- a/src/effects/TVGlitch.js +++ b/src/effects/TVGlitch.js @@ -18,7 +18,11 @@ const _ = imports.gettext.domain('burn-my-windows').gettext; import * as utils from '../utils.js'; +// We import some modules only in the Shell process as they are not available in the +// preferences process. They are used only in the creator function of the ShaderFactory +// which is only called within GNOME Shell's process. const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js'); +const Clutter = await utils.importInShellOnly('gi://Clutter'); ////////////////////////////////////////////////////////////////////////////////////////// // This effect combines the Glitch and the TV Effect. Credits go to Kurt Wilson // @@ -36,11 +40,6 @@ export default class Effect { // newly created shader instance. constructor() { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => { - // We import Clutter in this function as it is not available in the preferences - // process. This creator function of the ShaderFactory is only called within GNOME - // Shell's process. - const Clutter = imports.gi.Clutter; - // Store uniform locations of newly created shaders. shader._uSeed = shader.get_uniform_location('uSeed'); shader._uColor = shader.get_uniform_location('uColor'); diff --git a/src/effects/Wisps.js b/src/effects/Wisps.js index 478d487..5eb466c 100644 --- a/src/effects/Wisps.js +++ b/src/effects/Wisps.js @@ -18,7 +18,11 @@ const _ = imports.gettext.domain('burn-my-windows').gettext; import * as utils from '../utils.js'; +// We import some modules only in the Shell process as they are not available in the +// preferences process. They are used only in the creator function of the ShaderFactory +// which is only called within GNOME Shell's process. const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js'); +const Clutter = await utils.importInShellOnly('gi://Clutter'); ////////////////////////////////////////////////////////////////////////////////////////// // This effect lets your windows be carried to the realm of dreams by some little // @@ -36,11 +40,6 @@ export default class Effect { // newly created shader instance. constructor() { this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => { - // We import Clutter in this function as it is not available in the preferences - // process. This creator function of the ShaderFactory is only called within GNOME - // Shell's process. - const Clutter = imports.gi.Clutter; - // Store uniform locations of newly created shaders. shader._uSeed = shader.get_uniform_location('uSeed'); shader._uScale = shader.get_uniform_location('uScale');