🎉 Add initial matrix shader

This commit is contained in:
Simon Schneegans
2021-12-22 21:34:03 +01:00
parent 75b803d523
commit 547db3a2b8
6 changed files with 432 additions and 46 deletions
+10 -2
View File
@@ -13,7 +13,7 @@
'use strict';
const {Clutter} = imports.gi;
const {Clutter, Gio} = imports.gi;
const Workspace = imports.ui.workspace.Workspace;
const WindowManager = imports.ui.windowManager.WindowManager;
@@ -23,6 +23,7 @@ const ExtensionUtils = imports.misc.extensionUtils;
const Me = imports.misc.extensionUtils.getCurrentExtension();
const utils = Me.imports.src.common.utils;
const FireShader = Me.imports.src.extension.FireShader.FireShader;
const MatrixShader = Me.imports.src.extension.MatrixShader.MatrixShader;
//////////////////////////////////////////////////////////////////////////////////////////
// This extensions modifies the window-close animation to look like the window was set //
@@ -39,6 +40,10 @@ class Extension {
// from GNOME Tweaks, when you log in or when the screen is unlocked.
enable() {
// Load all of our resources.
this._resources = Gio.Resource.load(Me.path + '/resources/burn-my-windows.gresource');
Gio.resources_register(this._resources);
// Store a reference to the settings object.
this._settings = ExtensionUtils.getSettings();
@@ -127,7 +132,7 @@ class Extension {
tweakTransition('scale-y', 1);
// Instead, we add a cool shader to our window actor!
const shader = new FireShader(this._settings);
const shader = new MatrixShader(this._settings);
actor.add_effect(shader);
// Update uniforms at each frame.
@@ -144,6 +149,9 @@ class Extension {
// Tweaks, when you log out or when the screen locks.
disable() {
// Unregister our resources.
Gio.resources_unregister(this._resources);
// Restore the original behavior.
global.window_manager.disconnect(this._destroyConnection);