🔧 Do not import the ShaderFactory in the preferences process

This commit is contained in:
Simon Schneegans
2023-09-08 20:45:58 +02:00
parent 3f05c946ec
commit 14cd1db7e9
25 changed files with 205 additions and 180 deletions
+7 -6
View File
@@ -16,7 +16,8 @@
const _ = imports.gettext.domain('burn-my-windows').gettext;
import {ShaderFactory} from '../ShaderFactory.js';
const ShaderFactory =
typeof global !== 'undefined' ? (await import('../ShaderFactory.js'))?.default : null;
//////////////////////////////////////////////////////////////////////////////////////////
// This effect melts your windows. Inspired by the legendary screen transitions of the //
@@ -33,7 +34,7 @@ export default class Effect {
// GLSL file in resources/shaders/<nick>.glsl. The callback will be called for each
// newly created shader instance.
constructor() {
this.shaderFactory = new ShaderFactory(this.getNick(), (shader) => {
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
// Store uniform locations of newly created shaders.
shader._uActorScale = shader.get_uniform_location('uActorScale');
shader._uHorizontalScale = shader.get_uniform_location('uHorizontalScale');
@@ -65,7 +66,7 @@ export default class Effect {
// The effect is not available on GNOME Shell 3.36 as it requires scaling of the window
// actor.
getMinShellVersion() {
static getMinShellVersion() {
return [3, 38];
}
@@ -73,13 +74,13 @@ export default class Effect {
// required. It should match the prefix of the settings keys which store whether the
// effect is enabled currently (e.g. '*-enable-effect'), and its animation time
// (e.g. '*-animation-time').
getNick() {
static getNick() {
return 'doom';
}
// This will be shown in the sidebar of the preferences dialog as well as in the
// drop-down menus where the user can choose the effect.
getLabel() {
static getLabel() {
return _('Doom');
}
@@ -87,7 +88,7 @@ export default class Effect {
// This is called by the preferences dialog whenever a new effect profile is loaded. It
// binds all user interface elements to the respective settings keys of the profile.
bindPreferences(dialog) {
static bindPreferences(dialog) {
dialog.bindAdjustment('doom-animation-time');
dialog.bindAdjustment('doom-horizontal-scale');
dialog.bindAdjustment('doom-vertical-scale');