Skip to content

Port shader effects to GNOME Shell 51 and declare support - #319

Merged
dsheeler merged 1 commit into
dsheeler:mainfrom
camiloeferrera:fix/gnome-51-shader-effects
Oct 9, 2026
Merged

dsheeler merged 1 commit into
dsheeler:mainfrom
camiloeferrera:fix/gnome-51-shader-effects

Conversation

@camiloeferrera

Copy link
Copy Markdown
Contributor

GNOME Shell 51 removed Shell.GLSLEffect and Clutter.ShaderEffect.set_shader_source(), which breaks the extension on 51 (see #317):

TypeError: class heritage (intermediate value).GLSLEffect is not an object or null

This ports all three shader effects to the 51 API and declares support:

  • radialShader.js — extends Clutter.ShaderEffect, builds the fragment pipeline in vfunc_get_static_snippet() with Cogl.Snippet.new(), and sets uniforms by name via set_uniform_float(name, n_components, values).
  • color_effect.js / glitch_effect.js — replaces the removed set_shader_source() with vfunc_get_static_snippet() (declarations / main() body split from the existing .glsl files).
  • metadata.json — shell-version: ["51"].

Credit: the approach and the color/glitch port follow the reference patch and test evidence posted by @LavaTiger99 in #318. Thanks also to @gonwe for the initial radial shader port there. Opening this as a PR because the code in #318 as it stands uses new Cogl.Snippet(...) and set_uniform_value('brightness', <number>), both of which throw on the final GNOME 51 introspected API (Cogl.Snippet.new() is the introspectable constructor, and set_uniform_float() takes exactly (name, n_components, values) — the array length is consumed automatically).

Testing

CachyOS, GNOME Shell 51.0 / Mutter 51.0, Wayland (upgraded from 50):

  • Extension loads and enables with no JS errors (previously failed with the GLSLEffect TypeError above).
  • Switcher opens with window previews and background shading; next/previous navigation and activation verified (Alt-Tab end-to-end).
  • Radial effect construction validated in an isolated headless GNOME 51 session: vfunc_get_static_snippet() + named uniforms run clean, no GJS warnings.
  • Color/glitch: not exercised end-to-end by me; the port follows the reference patch validated in Fix radial shader compatibility with GNOME Shell 51 #318.

Note: this is intentionally a GNOME 51-only port — get_static_snippet does not exist in mutter 50, and set_shader_source no longer exists in 51, so preserving 50 support would require a runtime version check with both code paths. Glad to adjust if you'd prefer that.

- radialShader: use Clutter.ShaderEffect with vfunc_get_static_snippet() and Cogl.Snippet.new(), uniforms set by name
- color/glitch effects: replace removed set_shader_source() with vfunc_get_static_snippet()
- metadata: declare shell-version 51 (get_static_snippet is new in mutter 51)
@Neo-29

Neo-29 commented Oct 8, 2026

Copy link
Copy Markdown

This works , tested on arch

@dsheeler

dsheeler commented Oct 8, 2026

Copy link
Copy Markdown
Owner

Hi @camiloeferrera, @gonwe, and @LavaTiger99: thanks so much for the work on getting the gl effects sorted out for GNOME 51. I will do a bit more testing, but if all goes well, I will merge this PR which incorporates all of your efforts. Thank you!!!

@dsheeler

dsheeler commented Oct 8, 2026

Copy link
Copy Markdown
Owner

This works , tested on arch

Thanks @Neo-29 for testing!

@dsheeler
dsheeler merged commit ba25248 into dsheeler:main Oct 9, 2026
1 check passed
@Uchangeth

Copy link
Copy Markdown

This works , tested on Bazzite 45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants