diff --git a/docs/changelog.md b/docs/changelog.md index b3c3844..0f21e2a 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -11,6 +11,7 @@ SPDX-License-Identifier: CC-BY-4.0 #### New Features +- **Support for GNOME 48!** The extension has been updated to work with GNOME 48. - **New Effect: Aura Glow!** This effect adds a glowing aura to your windows. Thanks to [@jgarza9788](https://github.com/jgarza9788) for this contribution! - **New Effect: Mushroom!** This overly ridiculous effect is inspired by the animation of Super Mario when he eats a mushroom. Thanks again to [@jgarza9788](https://github.com/jgarza9788) for this contribution! - **New Effect: RGB Warp!** This effect warps the colors of your windows separating the color channels. Thanks once more to [@jgarza9788](https://github.com/jgarza9788) for this contribution! diff --git a/metadata.json b/metadata.json index db6b0cf..8d7ef22 100644 --- a/metadata.json +++ b/metadata.json @@ -9,7 +9,7 @@ }, "gettext-domain": "burn-my-windows", "settings-schema": "org.gnome.shell.extensions.burn-my-windows", - "shell-version": ["45", "46", "47"], + "shell-version": ["45", "46", "47", "48"], "url": "https://github.com/Schneegans/Burn-My-Windows", "version": 45 } diff --git a/src/Shader.js b/src/Shader.js index 3617622..fa5ba48 100644 --- a/src/Shader.js +++ b/src/Shader.js @@ -16,6 +16,7 @@ import Gio from 'gi://Gio'; import Shell from 'gi://Shell'; +import Cogl from 'gi://Cogl'; import GObject from 'gi://GObject'; import Clutter from 'gi://Clutter'; import Meta from 'gi://Meta'; @@ -115,8 +116,14 @@ export var Shader = GObject.registerClass({ this._timeline.set_duration(duration); this._timeline.start(); - // Make sure that no fullscreen window is drawn over our animations. - Meta.disable_unredirect_for_display(global.display); + // Make sure that no fullscreen window is drawn over our animations. Since GNOME 48 + // this is a "global" method. + if (Meta.disable_unredirect_for_display) { + Meta.disable_unredirect_for_display(global.display); + } else { + global.compositor.disable_unredirect(); + } + global.begin_work(); // Reset progress value. @@ -156,8 +163,13 @@ export var Shader = GObject.registerClass({ return; } - // Restore unredirecting behavior for fullscreen windows. - Meta.enable_unredirect_for_display(global.display); + // Restore unredirecting behavior for fullscreen windows. Since GNOME 48 this is a + // "global" method. + if (Meta.disable_unredirect_for_display) { + Meta.enable_unredirect_for_display(global.display); + } else { + global.compositor.enable_unredirect(); + } global.end_work(); this.emit('end-animation'); @@ -178,7 +190,9 @@ export var Shader = GObject.registerClass({ const declarations = code.substr(0, match.index); const main = match[1]; - this.add_glsl_snippet(Shell.SnippetHook.FRAGMENT, declarations, main, true); + this.add_glsl_snippet( + Cogl.SnippetHook ? Cogl.SnippetHook.FRAGMENT : Shell.SnippetHook.FRAGMENT, + declarations, main, true); } // We use this vfunc to trigger the update as it allows calling this.get_pipeline() in