Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Window blur #55

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Window blur #55

wants to merge 4 commits into from

Conversation

byteduck
Copy link
Owner

@byteduck byteduck commented Feb 23, 2023

These changes allow windows to apply blur to whatever is behind them via a new window hint. There are currently visual artifacts (such as when moving the cursor by a blurred window) that need to be ironed out, due to the way partial redraws of the display work (essentially, when only part of a blurred window is redrawn, it samples the already-blurred area that's not being redrawn, resulting in a weird double-blur).

The blur is currently done by applying multiple passes of a box blur to approximate a gaussian blur, but if anyone has suggestions for a faster algorithm I'm all ears.

Here's what it currently looks like (The opacity of the terminal background is lower than it will be in the final version to show off the blur):
Screenshot 2023-02-23 at 3 10 37 PM

@byteduck byteduck self-assigned this Feb 23, 2023
@byteduck byteduck added the userspace The issue is about a userspace application or service label Feb 23, 2023
@byteduck
Copy link
Owner Author

I made it so that if an area touching a blurred window needs to be redrawn, the entire blurred window is redrawn.

Obviously, this is far from ideal. Really, we'd want to redraw as little as possible. I tried an approach with using a hidden buffer to store the unblurred contents behind the window so that partial redraws are possible without "double-blurring", but, I feel like that's a little memory intensive. What's the best tradeoff here - keeping a whole new buffer for each window, or incurring some extra performance cost?

Work in progress. Adds a new window hint to blur contents behind a window. It currently uses an approximated gaussian blur by applying 3 passes of a box blur. There are currently a few visual artifacts (such as when moving the cursor around a blurred window) due to the way partial redraws work.
The blur algorithm had an error in the indexing for the vertical component of the blur and an error in the sliding window logic.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
userspace The issue is about a userspace application or service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant