Skip to content

blur: add blur_border config - #473

Open
the-eater wants to merge 1 commit into
wlrfx:masterfrom
the-eater:blur-border
Open

the-eater wants to merge 1 commit into
wlrfx:masterfrom
the-eater:blur-border

Conversation

@the-eater

Copy link
Copy Markdown
Member

expands the Exciting and New blur node to fit whole window!

@the-eater

Copy link
Copy Markdown
Member Author
blur_border <value>
yes 2025-11-24T17:52:38,275695630+01:00
no 2025-11-24T17:52:22,214170588+01:00

@WillPower3309 WillPower3309 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have we tested with stack / tabbed layouts with borders off (just titlebar should blur)?

Comment thread sway/desktop/output.c
wlr_scene_blur_set_corner_radius(blur,
container_has_corner_radius(closest_con) ? corner_radius : 0,
has_titlebar ? CORNER_LOCATION_BOTTOM : CORNER_LOCATION_ALL);
enum corner_location blur_corners = has_titlebar ? CORNER_LOCATION_BOTTOM : CORNER_LOCATION_ALL;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: 2 spaces before ?

Comment thread sway/desktop/output.c
Comment on lines +307 to +314
bool blur_has_corner_radius = container_has_corner_radius(closest_con);
int blur_corner_radius = blur_has_corner_radius ? corner_radius : 0;
if (closest_con && closest_con->blur_border && blur_has_corner_radius) {
blur_corners = CORNER_LOCATION_ALL;
blur_corner_radius += closest_con->current.border_thickness;
}

wlr_scene_blur_set_corner_radius(blur, blur_corner_radius, blur_corners);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cleanup suggestion:

int blur_corner_radius = 0;
if (closest_con && container_has_corner_radius(closest_con)) {
    blur_corner_radius = corner_radius;
    if (closest_con->blur_border) {
        blur_corners = CORNER_LOCATION_ALL;
        blur_corner_radius += closest_con->current.border_thickness;
    }
}
wlr_scene_blur_set_corner_radius(blur, blur_corner_radius, blur_corners);

@WillPower3309

Copy link
Copy Markdown
Member

One more nit: blur_decorations may be more descriptive as it includes titlebars

@ahfriedman

Copy link
Copy Markdown
Contributor

Have we tested with stack / tabbed layouts with borders off (just titlebar should blur)?

I did some testing with this PR today. The current changes do not impact tabbed/stacked containers. I'm still figuring out the source code, but I think the issue is that, for tabbed/stacked windows, the titlebar is created separately as part of arrange_children. As such, its extents aren't taken into account by the current code. Moreover, because the children themselves have blur, adding the code to position to blur in arrange_children (I suspect) would cause potential conflicts when the children themselves attempt to reposition the same blur when arrange_container gets called on them. As a novice, it would seem like the best solution to this might be to give the titlebars a unique blur node of their own. After all, I could see that potentially helping out PRs like #457. I'd be happy to try to play around with that idea (or any other suggestions you have to get this to work).

@WillPower3309

WillPower3309 commented May 6, 2026

Copy link
Copy Markdown
Member

Have we tested with stack / tabbed layouts with borders off (just titlebar should blur)?

I did some testing with this PR today. The current changes do not impact tabbed/stacked containers. I'm still figuring out the source code, but I think the issue is that, for tabbed/stacked windows, the titlebar is created separately as part of arrange_children. As such, its extents aren't taken into account by the current code. Moreover, because the children themselves have blur, adding the code to position to blur in arrange_children (I suspect) would cause potential conflicts when the children themselves attempt to reposition the same blur when arrange_container gets called on them. As a novice, it would seem like the best solution to this might be to give the titlebars a unique blur node of their own. After all, I could see that potentially helping out PRs like #457. I'd be happy to try to play around with that idea (or any other suggestions you have to get this to work).

thanks! We have a similar issue here as we do for drawing shadows on tabbed / stacked containers... I don't think this is currently handled elegantly so you could either look to the shadow logic for how to do the blur or come up with something better.

I suspect we can do this in the arrange_container logic by getting the y_offset of the parent container (int y_offset = con->current.height - height;) and then using this to position the blur node.

@WillPower3309

Copy link
Copy Markdown
Member

we'd need a rebase too!

@the-eater

the-eater commented May 7, 2026 via email

Copy link
Copy Markdown
Member Author

@ahfriedman ahfriedman mentioned this pull request May 7, 2026
6 tasks
@ahfriedman

Copy link
Copy Markdown
Contributor

Thank you both! I've opened a draft PR to track the status my attempted fixes to this (#527). While the offset suggestion seems to mostly fix the issues with tabbed/stacked containers, there still is a bug that I encountered when adding the logic to handle nested tabbed/stacked containers that I havent yet figured out. If you have a few minutes, would be happy to get your thoughts on it.

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.

3 participants