♻️ Use more dynamic imports
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user