Skip to content

fix(glass): global mode survives disabling stock Blur, tooltip corners, popup pop-in - #24

Merged
arcultus merged 3 commits into
mainfrom
fix/liquid-glass-rendering
Nov 30, 2026
Merged

arcultus merged 3 commits into
mainfrom
fix/liquid-glass-rendering

Conversation

@arcultus

Copy link
Copy Markdown
Contributor

Fixes three Fluctus Glass global-mode bugs on Plasma 6.8 / KWin 6.8.3 and clears every lint, compiler and CMake warning. All verified live by the reporter.

Disabling KDE's Blur effect turned off Liquid Glass

  • Symptom: turning off KDE's Blur effect also turned off Liquid Glass. It also made the dock's glass snap between sizes instead of animating smoothly.
  • Cause: on Wayland, KWin 6.8 tells apps whether blur is available with one shared on/off flag (ext_background_effect_v1), not a count of effects providing it. Fluctus Glass and stock Blur both switch it on. When Blur unloads, its destructor switches the flag off, even though Glass still provides blur. Plasma then:
    • switched to opaque backgrounds and stopped asking for blur, so global glass had nothing to draw;
    • stopped sending the dock its per-frame blur shape, so the dock glass fell back to slower updates over D-Bus, which looked like snapping.
  • Fix (glass/src/glasseffect.cpp): Glass keeps a pointer to the Blur effect and turns the flag back on the moment Blur is destroyed. KWin waits 100 ms before telling apps the flag went off, so they never see blur disappear. Glass finds Blur whether it loads before or after Glass, including when you toggle it in Desktop Effects. About a quarter-second after any Desktop Effects change it turns the flag on again as a safety net.

Tooltip corners didn't match the glass

A 5–6 px Breeze tooltip got glass with a ~16 px radius, leaving the dark tooltip corners poking out. The radius came from the area missing from the bounding box, which seams and the stepped Breeze mask inflate. Each corner is now fitted from the mask's edge profile:

  • seams and notches can't inflate it;
  • the square corners of a popup docked to a panel no longer halve the radius;
  • gaps under 1 px don't split a surface in two.

Checked against the real KSvg mask: 7.51 px, matching the live session. Tests now draw masks the way KSvg::FrameSvg::mask() does.

Start menu glass popped in after the slide

Sliding Popups forces WindowForceBlurRole and WindowForceBackgroundContrastRole for the whole slide, so stock Blur and Contrast painted over the glass until it ended. Glass hides both roles while the rest of the chain draws windows it rendered, then restores the exact values.

Also

  • Notices: the KCM, README and dock settings explain when the built-in Blur effect can be turned off and what then loses blur. The dock notice shows only when global mode is on and Blur is enabled.
  • Debugging: the state debug dump shows per-corner estimates and KWin's border radius.
  • justfile: just update / just glass update end with a bold yellow "log out and back in" reminder, because KWin keeps running the effect code it loaded at login.
  • Warnings (232 → 0) across clang-tidy, the compiler and CMake:
    • .clang-tidy turns off avoid-unchecked-container-access, which flagged every operator[] (121 hits), and excludes generated headers under build/.
    • The rest are fixed by hand; NOLINT with a reason only where Qt or KWin APIs leave no alternative.
    • The battery .js files skip their qmldir entry: Qt only looks for .pragma library in the first 128 bytes, which the SPDX header fills.

Testing

  • just test, just test-san and just lint are clean, plus a clean rebuild with no compiler warnings.
  • Live after re-login: tooltip corners line up, and turning stock Blur on and off keeps global glass and the smooth dock.

Not covered

  • Glass still uses one radius per shape, so a popup docked to a panel gets small rounded glass corners on its square side. A proper fix needs per-corner radii through the Rust renderer and shader.
  • Making Fluctus Glass the only blur provider in global mode would retire the role workaround.
  • Kickoff with stock Blur on has not been rechecked live.

🤖 Generated with Claude Code

arcultus and others added 3 commits November 30, 2026 21:52
…popup slides

Corner radius: estimate each corner by fitting a circle to the blur region's
edge profile instead of inverting the area missing from the bounding box. Seams
and notches no longer inflate the radius (a 5-6 px Breeze tooltip came out as
~16 px), square corners of popups docked to a panel are left out instead of
halving the radius, and gaps under 1 px no longer split a surface in two.
Tests now rasterise masks the way KSvg::FrameSvg::mask() does.

Popup pop-in: Sliding Popups forces WindowForceBlurRole and
WindowForceBackgroundContrastRole for the whole slide, which makes stock
Blur/Contrast paint over the glass until the slide ends. Hide both roles for
the downstream draw of windows we rendered and restore them afterwards.

Also: the effect's "state" debug dump shows per-corner estimates and KWin's
border radius, and the KCM, README and dock settings explain when KDE's
built-in Blur effect can be turned off (dock notice only with global mode on).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- .clang-tidy: disable cppcoreguidelines-pro-bounds-avoid-unchecked-container-access
  (121 hits, one per operator[]; .at() would add bounds checks to the per-frame
  physics and layout paths) and exclude generated headers under build/.
- Fix the rest by hand: ranges algorithms and QList::removeIf, designated
  initializers, std::array, Q_DISABLE_COPY_MOVE on QObject classes, member
  initializers, [[nodiscard]], widening casts, a duplicated switch branch.
- Annotate with NOLINT and a reason where Qt/KWin APIs leave no alternative
  (ItemChangeData union, int paint masks, EGL proc address, const debug()).
- battery: skip qmldir entries for Style.js/Presets.js. They are imported by
  path, and Qt only looks for '.pragma library' in the first 128 bytes, which
  the SPDX header fills.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
KWin 6.8 tells Wayland clients whether blur is available through one shared
flag of ext_background_effect_v1, not a count of providers. Fluctus Glass and
stock Blur both set it, and Blur clears it in its destructor even while global
mode still serves blur. Plasma then switched to opaque surfaces and stopped
sending blur regions: global glass went dark, and the dock's glass fell back to
D-Bus geometry updates, which made it snap instead of animate.

Track the stock Blur effect (found at load, on window add, on reconfigure and
on kwinrc [Plugins] changes) and set the flag again as soon as it is destroyed.
KWin delays the removal by 100 ms, so clients never see blur go away. A
re-assert shortly after any Desktop Effects change is the safety net.

Also print the "log out and back in" reminder after updating the effect in bold
on a terminal: KWin keeps running the effect code it loaded at login.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@arcultus
arcultus merged commit b6fae39 into main Nov 30, 2026
2 checks passed
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.

1 participant