Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add inner rounding of corners #54

Open
Iss-in opened this issue Dec 12, 2021 · 16 comments
Open

Add inner rounding of corners #54

Iss-in opened this issue Dec 12, 2021 · 16 comments
Labels
enhancement New feature or request

Comments

@Iss-in
Copy link

Iss-in commented Dec 12, 2021

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

@Iss-in Iss-in added the enhancement New feature or request label Dec 12, 2021
@fowlerro
Copy link

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

@fluix-dev
Copy link
Owner

Here's some early work in progress.
screenshot_20220206_225917

@fluix-dev fluix-dev changed the title Inner borders Add inner rounding of corners Feb 7, 2022
@momofor
Copy link

momofor commented Feb 8, 2022

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

@ErikReider
Copy link

ErikReider commented Feb 8, 2022

Which branch are you working in? This looks sick!

@fluix-dev
Copy link
Owner

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.

@ErikReider
Copy link

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

Are you talking about stacked and tabbed windows?

@fluix-dev
Copy link
Owner

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

Are you talking about stacked and tabbed windows?

Precisely.

@ErikReider
Copy link

@fluix-dev
Copy link
Owner

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.

@ErikReider
Copy link

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

@ackstorm23
Copy link

Any updates on this?

@EysseW
Copy link

EysseW commented Jun 24, 2022

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.

@fluix-dev
Copy link
Owner

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:

" vec4 debug_color = vec4(v_texcoord.x, v_texcoord.y, 0.5, 1);\n"

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:

&dst_box, alpha, &mask, 20);


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.

@ErikReider
Copy link

ErikReider commented Jun 24, 2022

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?

@EysseW
Copy link

EysseW commented Jun 24, 2022

You are amazing dude! Trying it out today!

@fluix-dev
Copy link
Owner

fluix-dev commented Aug 13, 2022

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants