scenefx icon indicating copy to clipboard operation
scenefx copied to clipboard

feat: add borders

Open WillPower3309 opened this issue 2 years ago • 8 comments

TODO:

  • [x] border setting
  • [x] add border width to corner radius
  • [x] border stencil
  • [x] proper damage tracking
  • [ ] support scaled and rotated outputs
  • [ ] decrease buffer size by border size (otherwise the borders can mess up gaps because they increase the visual size of the surface)
  • [x] remove slight rounding with corner radius of 0

WillPower3309 avatar Oct 19 '23 06:10 WillPower3309

will fix meson.build next commit

WillPower3309 avatar Oct 19 '23 06:10 WillPower3309

Need to fix a weird bug, corners of the borders don't round, and the stencil cuts out the window surface texture as well as the border area

WillPower3309 avatar Oct 20 '23 06:10 WillPower3309

What about moving this into a sister-node to our wlr_scene_buffer as a new node type? We could provide shadow control, border x/y offset, width, height, etc without messing with the wlr_scene_buffer struct as intended by the wlroots devs:

image

This would allow the comp to add multiple borders as discussed earlier.

But then again, we could just add those variables to the wlr_scene_buffer struct and get the same result

ErikReider avatar Oct 20 '23 11:10 ErikReider

What about moving this into a sister-node to our wlr_scene_buffer as a new node type? We could provide shadow control, border x/y offset, width, height, etc without messing with the wlr_scene_buffer struct as intended by the wlroots devs:

image

This would allow the comp to add multiple borders as discussed earlier.

But then again, we could just add those variables to the wlr_scene_buffer struct and get the same result

Thanks for closing out this couple of items I had to do, I agree. I was actually going to suggest something similar, partly since shadows also depend on border values

WillPower3309 avatar Oct 20 '23 14:10 WillPower3309

Just need to fix a corner issue and close out the scaling / rotation and this is done!

WillPower3309 avatar Oct 26 '23 05:10 WillPower3309

I'll try to close out the last bit tomorrow

WillPower3309 avatar Oct 26 '23 05:10 WillPower3309

2023-11-01_01-11-1698815715 Still a bit of corner cropping, almost seems like the stencil is also applying to the surface texture

WillPower3309 avatar Nov 01 '23 06:11 WillPower3309

Might rename the function to render_rect_around_rect, to make it less specific to borders, as compositors should be able to use it for titlebars too

WillPower3309 avatar Nov 02 '23 06:11 WillPower3309