Repository navigation
Settings: themes can blur the sidebar, panel, composer, headers, menus and dialogs; shaders get iMouse (#464) - #472
Open
MopigamesYT wants to merge 2 commits into
Open
MopigamesYT wants to merge 2 commits into
MopigamesYT wants to merge 2 commits into
Conversation
…ders, menus and dialogs (#464) A theme file's [blur] gives these elements a blur radius and [blur_tint] the translucent colour over it. third_party/fyne gains canvas.Blur: the GL painter copies what is already drawn under it, blurs it with dual Kawase passes in framebuffer objects and draws it back clipped to the element's rounded corners. Off on CPU renderers and GL older than 3.0, where the elements keep their opaque look.
…side (#464) iMouse is the pointer in gl_FragCoord's pixels (xy) and the last press (zw, z negative once released), raw, kept where the pointer left the window; u_mouse_inside says whether it is over the window. The shader is drawn again on a move only when it uses them (desktop.OnPointer and canvas.Shader.Uses in third_party/fyne). aurora.frag glows around it.
7 tasks
Member
Author
|
Blur measured on this branch for the performance audit, all six elements over the aurora shader on a virgl VM: the idle frame goes from 6.1 to 12.5 ms p50 (+16 % of a core) as soon as a radius is set, and barely changes from 8 to 32. Numbers and targets are in #474 ( |
This was referenced Nov 16, 2026
Member
Author
|
Heads-up from testing the open PRs merged together: this PR and #478 both change |
tpm28
approved these changes
Nov 18, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #464
Summary
[blur]table gives a blur radius (0–64) tosidebar,panel(side/tool panel),composer,headers(split-pane headers),menusanddialogs. What is behind them (the shader or picture background, or the window behind a menu/dialog) shows through really blurred on the GPU.[blur_tint]sets the translucent colour laid over the blur (#rrggbbaa). If you leave it out, the element uses its own colour at 60 % (menus 50 %, dialogs 88 %).roundness), works over dark and light bases, reloads when the file is saved, and bad values show the same red error as other theme keys (blur.sidebar: 65 is outside 0 to 64, unknown element, bad tint).vec4 iMouseworks like Shadertoy's, butxyfollows the pointer even with no button held. Positions are ingl_FragCoordpixels from the bottom left.zwis the last press, andzturns negative after release. Positions are raw (not eased) and stay where the pointer left the window.float u_mouse_insideis 1 while the pointer is over the window. The shader is redrawn on pointer moves only if it actually uses these uniforms (checked against the compiled program), so other shaders cost nothing extra.aurora.fragnow glows around the pointer, andaurora.tomluses blur.docs/THEMES.md(new### blursection, uniforms table) and in theNew themetemplate. The agent's settings tool already points to docs/THEMES.md.Screenshots
Real captures from the app (taken in-process on a GPU, Wayland/niri). The same Aurora theme with and without
[blur]:These "after" shots use a
#0c0c0c80sidebar tint, which turned out too light for muted text. The committedaurora.tomluses darker tints (b8–c8).iMouseon the linux-test VM (KDE Wayland, llvmpipe, so blur is off there as intended), with the pointer moved by ydotool: the highlight follows it.Technical details
third_party/fyne/canvas/blur.go:canvas.Blur, a backdrop-filter object. Fyne paints in tree order, so when the blur is painted, everything behind it is already in the framebuffer.third_party/fyne/internal/painter/gl/blur.go: copies the region (plus 1.5× the radius as padding) withglCopyTexSubImage2D, then runs dual Kawase: 1–6 downsample passes into FBO textures at half size each, then upsample passes. The last upsample is drawn into the frame with a rounded-rect SDF mask (per-corner radii). The painter now remembers its scissor clip and viewport so it can restore them. FBO/GetStringcalls are only on the desktop GL and GLES contexts (blur_gl_core.go,blur_gl_es.go). wasm/gomobile draw nothing for it.blurUsablerejects llvmpipe/softpipe/swrast/SwiftShader/GDI Generic and GL < 3 (unit test). The first failure callscanvas.SetBlurUnsupportedand the UI drops back to opaque.internal/ui/theme_blur.go:blurBehind(element, fill, token)wraps the long-lived backgrounds (sidebar, pane header, tool panel card, composer card). It syncs after every theme apply, after the recolouring pass. Sheets (menus/dialogs) get aliveblur: under the panel for a menu, the whole window (then dimmed) for a dialog. When it's on, the one-shot CPU frost capture is skipped.desktop.OnPointer(GLFW cursor pos/button/leave callbacks) andcanvas.Shader.Watch/Uses(glGetUniformLocation != -1after linking).Frame time
ONELOOP_BENCH=idle(10 s, aurora shader animating at 30 fps, so every frame repaints the blur). GPU machine,paintis the CPU time of the paint call:[blur](2 runs)[blur]sidebar+panel+composer (2 runs)So about +0.25 ms of paint per frame with three blurred elements. Present (where the GPU work shows) moves between runs.
Tests
go build ./...,go vet(ui, palette, fyne gl/canvas/desktop),go test ./internal/palette ./internal/ui(the known flaky worktrees.go crash showed up once and passed on rerun),go testof fyne'sinternal/painter/gl(newTestBlurUsable), plus GLES and wasm builds of the painter. Settings are untouched.Not verified
panel/headerselements on screen (they use the same wrapper as the sidebar).Assisted-by: Claude Opus 5.5 low
🤖 Generated with Claude Code