berry icon indicating copy to clipboard operation
berry copied to clipboard

berrywm: rounded corners

Open Sidd-Dino opened this issue 3 years ago • 11 comments

rounded corners for windows

default radius : 20

Can be configured by 
berryc border_radius X

Patch: https://patch-diff.githubusercontent.com/raw/JLErvin/berry/pull/145.patch

I doubt this goes with this version of berry will fit the idea that @JLErvin has for this project but i made it as way to learn my way around X and Xlib

Known Bugs :
>  Wonky behavior with decorations and headers

\o/ Gotta give credit to this sauce of inspiration

Sidd-Dino avatar Jul 23 '21 07:07 Sidd-Dino

<> Screenshot scrot

Sidd-Dino avatar Jul 23 '21 08:07 Sidd-Dino

This is a very good start, and something that I would really like to be included in berry. However, it looks like it needs some adjustment for windows which are decorated. I think that, ideally, both the client and the client's decoration would have rounded corners. Or, perhaps this would be a configurable value.

JLErvin avatar Jul 23 '21 19:07 JLErvin

Oh the client and client_decoration is huge pain. For now rounded corners are being tested because of the problems that appear below

no_borders scrot_no_borders

inner_border 5 scrot_inner_border

border 5 scrot_border

When any border is added It's perfect at the (0,0) of client and client_dec windows. everywhere else it just gets misaligned. Which makes no sense. I checked the code but i cant for the life of me figure out how it's getting influenced.

Sidd-Dino avatar Jul 23 '21 20:07 Sidd-Dino

Progress

no borders

no_border_scrot

inner border

in_border_scrot

outer border

out_border_scrot

outer + inner border

out+in_border_scrot

title

I made a mistake with this. Will be patched in the next commit.

Thoughts

I have no clue how to proceed further Any modifications past this is design choices

Sidd-Dino avatar Jul 24 '21 09:07 Sidd-Dino

Progress

title + no_border

title+in_border_scrot

title + inner border

title+inner_border_scrot

Sidd-Dino avatar Jul 24 '21 09:07 Sidd-Dino

I actually quite like this patch and think that this is something that would really attract people to berry. I need to do some more testing before I'm ready to merge it, but I will leave some comments in the meantime. Thanks for taking the time to work on this! :)

JLErvin avatar Jul 25 '21 04:07 JLErvin

I need to do some more testing before I'm ready to merge it,

Currently the only problem I've found is when border_width is set to a non zero value. This creates visual artifacts on every corner of the window with said border.

outer border

out_border_scrot

outer + inner border

out+in_border_scrot

I believe the outer_border is being applied by the function ewmh_set_frame_extents() Which uses XChangeProperty() to apply the outer_border Which creates a border that doesn't span underneath the window like inner_border

I dont know how to solve it :/

Sidd-Dino avatar Jul 25 '21 04:07 Sidd-Dino

Unfortunately I haven't had much time to write up a solution for this, although I don know what the issue is. Behind each client window there is a decoration window. When borders are enabled, this window is ever so slightly larger than the client window, giving the illusion of a "border". When double borders are enabled, another border is added to the decoration window (using XLib's built-in API).

The issue comes into play because, when we round the decoration window, we are only rounding it's outer-most edge (i.e., it's border). This is an issue because we also want to round the inner edge (i.e. the edge of the base decoration window). I haven't had much time to dive into how to round is actually working, but so long as we could applying rounding to that inner-most window, it should resolve.

JLErvin avatar Aug 07 '21 21:08 JLErvin

I'll start working on berrwm again. I'd taken a break ( ;-; lost motivation to continue )

I'll start experimenting right away I'll keep updating on my progress 'u'

*I'm sorry dude i changed the title cos i wanted a damn space between ...wm: and roun...

Sidd-Dino avatar Aug 08 '21 04:08 Sidd-Dino

any progress on this?

acoolstraw avatar Jan 21 '22 08:01 acoolstraw

image the outer border doesn't go around the corner and I don't want an inner border :/

acoolstraw avatar Jan 21 '22 08:01 acoolstraw