sway-borders icon indicating copy to clipboard operation
sway-borders copied to clipboard

Add inner rounding of corners

Open isshin1 opened this issue 3 years ago • 16 comments

any hope for inner round corners yet ? it will be awesome to have round corners for floating windows without any border

isshin1 avatar Dec 12 '21 14:12 isshin1

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

fowlerro avatar Jan 26 '22 11:01 fowlerro

Here's some early work in progress. screenshot_20220206_225917

fluix-dev avatar Feb 07 '22 04:02 fluix-dev

That looks so good, are you planning on adding anti aliasing to it ?

momofor avatar Feb 08 '22 16:02 momofor

Which branch are you working in? This looks sick!

ErikReider avatar Feb 08 '22 18:02 ErikReider

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.

fluix-dev avatar Feb 08 '22 21:02 fluix-dev

I've yet to do much thinking on how containers are going to work though.

Are you talking about stacked and tabbed windows?

ErikReider avatar Feb 08 '22 22:02 ErikReider

I've yet to do much thinking on how containers are going to work though.

Are you talking about stacked and tabbed windows?

Precisely.

fluix-dev avatar Feb 08 '22 23:02 fluix-dev

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/

ErikReider avatar Feb 08 '22 23:02 ErikReider

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.

fluix-dev avatar Feb 09 '22 00:02 fluix-dev

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

ErikReider avatar Feb 16 '22 14:02 ErikReider

Any updates on this?

ackstorm23 avatar Jun 18 '22 17:06 ackstorm23

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.

EysseW avatar Jun 24 '22 00:06 EysseW

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.

fluix-dev avatar Jun 24 '22 02:06 fluix-dev

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?

ErikReider avatar Jun 24 '22 09:06 ErikReider

You are amazing dude! Trying it out today!

EysseW avatar Jun 24 '22 11:06 EysseW

@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.

screenshot_20220812_232722

fluix-dev avatar Aug 13 '22 03:08 fluix-dev