sway-borders
sway-borders copied to clipboard
Add inner rounding of corners
any hope for inner round corners yet ? it will be awesome to have round corners for floating windows without any border
Yep, I am waiting for that, the only reason I don't use sway, is no way of making window corners rounded and making that with border and images is not good, that doesn't look nice on all apps Would be nice to see any info about this feature
Here's some early work in progress.

That looks so good, are you planning on adding anti aliasing to it ?
Which branch are you working in? This looks sick!
That looks so good, are you planning on adding anti aliasing to it ?
Yes.
Which branch are you working in? This looks sick!
Haven't pushed any commits yet; this is literally editing the shaders used by the GLES2 renderer in wlroots.
I'll be creating a custom renderer with its own shaders so a different wlroots version won't be required. I've yet to do much thinking on how containers are going to work though.
I've yet to do much thinking on how containers are going to work though.
Are you talking about stacked and tabbed windows?
I've yet to do much thinking on how containers are going to work though.
Are you talking about stacked and tabbed windows?
Precisely.
Yeah, you don't want something like this: https://www.reddit.com/r/i3wm/comments/ndo9iy/i_am_using_i3gaps_with_picom_and_this_is_how_my/
Well that is exactly what I'm trying to avoid, but given picom does that right now, maybe I don't need to worry about it just yet.
By default the titlebar text is centered right? Why not make it rounded too and add some padding to the text so that it won't get clipped
Any updates on this?
I don't wanna be annoying, but have you got a branch or something we could play around with? I personally would not care about any bleeding edge stuff as long as it means I can use rounded corners. I need that shit.
I've pushed https://github.com/fluix-dev/sway-borders/tree/beta so you can play around with. It's based on upstream Sway, not this fork so it's super bare and limited, but you can set inner, rounded borders. You can set the color here: https://github.com/fluix-dev/sway-borders/blob/970b52a1cebf74119c3adaf9f6159f026f66ae80/sway/desktop/renderer.c#L45
With the format vec4 debug_color = vec4(r, g, b, a); (r, g, b, and a being 0-1 values).
The radius can be set by replacing the 20 with whatever you like here: https://github.com/fluix-dev/sway-borders/blob/970b52a1cebf74119c3adaf9f6159f026f66ae80/sway/desktop/render.c#L184
My main issue is figuring out how to have everything (inner rounding, outer padding, and future work like blur) work together, but I think I've been overthinking it. I'm going to try and just use the existing code + adding on the work in this branch for inner padding, and configuration changes and see how that works out. Maybe I'll have to rewrite it again when adding blur, but that's better than having nothing for months/years at a time.
Hmmm. Won't compile for me due to:
#include <render/gles2.h>
#include <render/egl.h>
Am I missing something?
Edit: Seems like wlr_gles2_renderer isn't included in my /usr/include/wlr/render/gles2.h. Should I clone wlroots as a subproject?
You are amazing dude! Trying it out today!
@ErikReider you were correct, those functions were made private some time ago. I've pushed some more WIP commits to the beta branch, so please give those a try at compilation. The branch has (for now) lost its border colours (as I work on putting them on the outside of windows) but gained anti-aliasing (see below)! Radius is hardcoded to 50 but can be changed on lines 136 and 283 of sway/desktop/render.c and recompiled.
