Skip to content
This repository was archived by the owner on Nov 20, 2025. It is now read-only.

fix (static-blur): Invalidate cached wallpaper when changed#272

Open
Kayzels wants to merge 2 commits into
taj-ny:mainfrom
Kayzels:wallpaper-fix
Open

fix (static-blur): Invalidate cached wallpaper when changed#272
Kayzels wants to merge 2 commits into
taj-ny:mainfrom
Kayzels:wallpaper-fix

Conversation

@Kayzels
Copy link
Copy Markdown

@Kayzels Kayzels commented Nov 5, 2025

Problem: With the change to Plasma 6.5, the static blur is now no longer correctly recalculated when wallpapers or activities change. This means that a dark blur can show when in light mode, and vice versa. Previously, I think checking the frameGeometry for the changed window against a boundingRect worked. But now, it seemed that that boundingRect always had a size of 0, and so the cache was never cleared.

Solution: Instead of checking the window dimensions, use DBus to find out if a wallpaper has changed, and if so, clear the cached texture for that screen. I've tried to make it so that the DBus connection is only created and used if static blur is enabled, and the wallpaper is used.

Note: This does not solve the issue with the cached textures being wrong when switching between activities. I'm struggling to get that working: it seems that the currentActivityChanged signal happens before it changes the wallpaper, so clearing the cache will just calculate the same wallpaper as before, so Activity 2 would get the wallpaper for Activity 1 cached, and vice versa. I also haven't tested this in X11, as I don't have that on my system.

@taj-ny
Copy link
Copy Markdown
Owner

taj-ny commented Nov 6, 2025

That still won't invalidate the static blur texture if icons or widgets change. Try using the Window::damaged, WindowItem::damaged or SurfaceItem::damaged signals (on the desktop window) instead, though you'll have to check if moving a window or the software cursor (launch KWin with KWIN_FORCE_SW_CURSOR=1) causes unnecessary invalidations.

@Kayzels
Copy link
Copy Markdown
Author

Kayzels commented Nov 6, 2025

Try using the Window::damaged, WindowItem::damaged or SurfaceItem::damaged signals (on the desktop window) instead, though you'll have to check if moving a window or the software cursor (launch KWin with KWIN_FORCE_SW_CURSOR=1) causes unnecessary invalidations.

Not a bad idea, I wasn't aware of those.

I've tried with both Window::damaged and SurfaceItem::damaged. They do work for cache invalidation, but you were right to worry that it invalidates too frequently. Basically, every single time a window (or widget) appears on the desktop, that gets triggered. So it would constantly be recalculating the texture, which defeats the purpose of it being a static blur.

I couldn't figure out how to limit it: I tried adding a QTimer to denounce those, but they were so frequent that the timeout never happened. Not really sure what else to try, to limit the redraw, but still have it aware of the changes.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants