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

[$40] Antialiased Rounded Corners #214

Closed
zezic opened this issue Aug 1, 2019 · 13 comments
Closed

[$40] Antialiased Rounded Corners #214

zezic opened this issue Aug 1, 2019 · 13 comments
Labels
feature Feature request help wanted SOMEBODY PLEASE HELP

Comments

@zezic
Copy link

zezic commented Aug 1, 2019

This is a feature request for the antialiased rounded corners on the compositor level. They should have radius setting and window exclude/include rules like it's already done for shadows and blur. They should be able to override the alpha channel of window by multiplying it with 0 on transparent areas and also they should be able to round the top corners of WM-powered window decoration (like decorations from Openbox). They should be able not to lose the existing alpha channel of the window to make it possible to round corners of already partially-transparent windows (like terminals).

Let's try to fund the development of rounded corners: https://www.bountysource.com/issues/78071871-antialiased-rounded-corners
Thread on r/unixporn: https://www.reddit.com/r/unixporn/comments/cko6km/funding_rounded_corners/

@zezic zezic changed the title [$$] Antialiased Rounded Corners [$10] Antialiased Rounded Corners Aug 1, 2019
@yshui yshui added the feature Feature request label Aug 1, 2019
@yshui
Copy link
Owner

yshui commented Aug 1, 2019

Just to clarify: you want compton to cut off the corners of rectangular windows so they would have rounded corners?

@Elv13
Copy link

Elv13 commented Aug 2, 2019

(one of AwesomeWM dev here)

This is a common users complaint (including other WMs like BSPWM and the patched version of i3-gaps). The ideal scenario is that the compositor (compton) take the X11 bounding mask and use it for the shadow (and add anti-aliasing to it instead of being 1 bit per pixel). AwesomeWM users work around this by using an ARGB surface with "client side decoration" (aka, titlebars on each side) made partially transparent. However that breaks compton shadows, which expect a rectangle. So they also have to use client side shadows, but that comes with their own drawbacks (tiling offsets, client snapping, maximization/fullscreen issues, etc). Other WMs users have no way to work around it at all.

Simply adding rounded corner to compton would not, in itself, work. Since shadows/glows and other parts expect rectangles anyway, it will be glitchy at best. Better run an anti-aliasing algorithm on the 1bpp shape bounding mask, use this to clip the window and use an other shape tracing algorithm to shape the shadow path. Another corner case will be windows with holes in their shape. This isn't as uncommon as one might think. There is screenshot on reddit.com/r/unixporn almost every week using such setup (mostly using FVWM, AwesomeWM and WindowMaker, afaik, Plasma and Enlightenment also allow this). And if solving this sound painful and complicated, it is because it probably is. Note that I don't know the modern Compton codebase.

@zezic
Copy link
Author

zezic commented Aug 2, 2019

@yshui Yes, exactly. Cut off corners of all windows with a radius regardless of the actual alpha mask provided by the clients behind those windows.

If window is already semi-transparet (examples: xeyes or terminal with transparency) its mask must be used and cutted off with a radius at corners.

@Elv13 you are right about windows with non-rectangular shape, but at the moment, I think, we can forgive about them. Usually the radius of window corners to be used is about 3 to 7 pixels and shadow radius is much bigger, so the rectangular nature of the shadow should not be so notable. What's about wmx - it's really pretty rarely used WM, at least it's users just will be able to not enable corner radius feature in compton and use it as they used it before.

@Elv13
Copy link

Elv13 commented Aug 2, 2019

What's about wmx - it's really pretty rarely used WM

It was the most recent (24 hours ago) example on r/unixporn with holes in the bounding clip shape. There's about ~20 other in the AwesomeWM screenshot issue (click "load more" a few time). Including one by me near the top using Compton with visible artifacts.

But overall I came here to "warn" about these corner (pun intended) cases so people know this isn't an easy problem and that other investigated ways to make it work before. "Really" solving the issue wont be easy at all, ancient X11 design decisions (1bpp raster bitmap maks) get in the way. Plus rounded corners are the most popular, but hexagonal corner and detached elements (like the wmx screenshot) are also good looking and used in the wild. People will bark about them even if rounded corner get AAed.

@zezic zezic changed the title [$10] Antialiased Rounded Corners [$30] Antialiased Rounded Corners Aug 2, 2019
@zezic
Copy link
Author

zezic commented Aug 2, 2019

People will bark about them even if rounded corner get AAed.

Sure, they will, but I hope, these two things can live side a side from each other.

@Elv13 Here is a preview to clarify this feature request:
corners

By the way it would be nice to make the "Zero the part of the shadow's mask behind the window." also known as clear-shadow option to work correctly when rounded corners enabled to make semi-transparent terminals not so dark.

@zezic
Copy link
Author

zezic commented Aug 2, 2019

It will be almost perfect if there will be a feature to set the radius of each corner separately from the radius of other corners to make it usable for bottom/side docks.

@yshui yshui added the help wanted SOMEBODY PLEASE HELP label Aug 16, 2019
@zezic zezic changed the title [$30] Antialiased Rounded Corners [$40] Antialiased Rounded Corners Aug 29, 2019
@tricktux
Copy link

@zezic is there a paypal or some other form of helping fund this request. I would like to, but have had ton of issues with bountysource in the past. Thanks for funding this.

@zezic
Copy link
Author

zezic commented Nov 17, 2020

@tricktux I think, now it's better to ask @yshui about better ways of doing this. I just wanted to make some noise and picked what came into my mind first (Bountysource).
Also, I'm not sure how to properly manage the bounty when the task will be done, because there are many people involved into this task, besides @yshui there are @sdhand, @ibhagwan, @tryone144 and maybe someone else, and bounty is so so so little for so much people, haha. I will take any suggestion from @yshui, maybe these pennies can be spend on hosting or some other things to make the project better, I don't know.

@yshui
Copy link
Owner

yshui commented Nov 17, 2020

@zezic Hmm, I don't know how Bountysource handle splits. Personally I think the biggest contributor to this is @sdhand and @ibhagwan, so this bounty should go to them. (And they could fight it out between themselves XD)

In fact, they probably can already make the claim, since you can pretty much get rounded corners with their branches. It's just me who is being slow at adopting their changes.

@ibhagwan
Copy link

Thanks @yshui! I don’t really know what the bounty is, pennies or otherwise this was never on my mind, kindly utilize the bounty in the best way for the project, perhaps hosting as @zezic suggested :)

@tricktux
Copy link

tricktux commented Nov 17, 2020 via email

@yshui
Copy link
Owner

yshui commented Nov 17, 2020

it would probably be great to setup a sponsor page for the repo.

Hmm, this project doesn't really have monetary expenses at the moment. And organizing the fund sounds like a lot of work...

I'd like to hear what @tryone144 thinks about this.

@absolutelynothelix
Copy link
Collaborator

closing as done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request help wanted SOMEBODY PLEASE HELP
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants