How to transform the app_server code to use compositing | Haiku Project

Semi-transparent window parts can be done with BDirectWindow and special visible region calculation. No per-window compositing is needed.

5 Likes

Can’t a BBitmap be used as mask for the shape of the window? That would be similar to how arbitrary shapes are achieved on X.

1 Like

I believe that was dockbert. I recall using it on r5.

True. There is an X terminal program that does transparency without compositor. Urxvt I think? It does this by taking a snapshot of the portion of the screen that it occupies, and renders that into its own frame. Pretty slick and lightweight. Works great in environments where you don’t drag windows around, like a tiling window manager, as the background snapshot would move with the window until it redraws upon placement.

Yes, there is just no easy to use API to do it. It’s not really a matter of complex implementation, just exposing it to apps in a convenient way.

2 Likes

But then why recalculating whole region? That should be part of API, an abstraction layer.

Yes, ideally new API for semi-transparent windows is needed. I made some thoughts about how it can made with existing API and mechanisms.

1 Like

Rectangles can also be 1x1 so in theory you could do anything with BRegion. In fact, the original ClipToPicture implementation just did that (maybe still do?).

Of course, this does not scale that well

BRegion supports only 1 bit monochrome masks. It do not support semi-transparency and alpha-blending (rectangle array stuff can be seen as RLE-like compression technology). So it can’t be used for modern windows graphics like shadows.

1 Like