-
Notifications
You must be signed in to change notification settings - Fork 31
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
hwcomposer: Use dummy buffer as window background in subsurface mode #12
Conversation
Rebased and fixed. This MR doesn't depend on #22, I just messed it up when splitting things out. |
HWC assumes that there's an implicit solid black layer below all the other layers to compose onto. Since we already have a dummy buffer attached to the xdg-toplevel surface, it can be used to provide that background in single window mode, which fixes some apps having transparent background in unexpected places. Thanks to wp_viewporter, the buffer can still be just a single pixel, which gets upscaled to cover the whole window by the compositor. Since multi window mode relies on the background being transparent, keep it that way there by allowing to specify window background color in create_window.
When the background is transparent, we don't want it to consume any input events. Similarly, when the background is fully opaque, we know that the whole surface is opaque too, so we can mark it as such to allow the Wayland compositor to optimize its drawing.
@dos1 looks like the ubports compositor doesn't implement viewporter so this (as well as your other changes involving the viewporter) breaks compositing there... |
Ah, yeah. Any reasonably modern compositor should already support viewports, but well, UBport's Mir sure doesn't qualify to such title... Won't be a big deal though, it's just a matter of sprinkling stuff with bunch of ifs. Of course crops will stay broken on such compositors, but at least the background can still be provided by creating a full-sized buffer instead. |
HWC assumes that there's an implicit solid black layer below all the other layers to compose onto. Since we already have a dummy buffer attached to the xdg-toplevel surface, it can be used to provide that background in single window mode, which fixes some apps having transparent background in unexpected places. Thanks to wp_viewporter, the buffer can still be just a single pixel, which gets upscaled to cover the whole window by the compositor.
Since multi window mode relies on the background being transparent, keep it that way there by allowing to specify window background color in create_window.
When the background is transparent, we don't want it to consume any input events.
Similarly, when the background is fully opaque, we know that the whole surface is opaque too, so we can mark it as such to allow the Wayland compositor to optimize its drawing.
Also, don't leak the dummy wl_buffer on window destroy.