render: better description of why we disable transparency in fullscreen

This commit is contained in:
Daniel Eklöf 2023-10-10 09:27:00 +02:00
parent 5c58fc2a28
commit 4cf2c45baa
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -529,22 +529,32 @@ render_cell(struct terminal *term, pixman_image_t *pix, pixman_region32_t *damag
/* /*
* Note: disable transparency when fullscreened. * Note: disable transparency when fullscreened.
* *
* This is because the wayland protocol recommends * This is because the wayland protocol mandates no
* (mandates even?) the compositor render a black * screen content is shown behind the fullscreened
* background behind fullscreened transparent windows. * window.
* *
* In other words, transparency does not work when * The _intent_ of the specification is that a black
* fullscreened, in the sense that you don't see * (or other static color) should be used as
* what's behind the window. * background.
* *
* And if we keep our alpha channel, the background * There's a bit of gray area however, and some
* color will just look weird. For example, if the * compositors have chosen to interpret the
* background color is white, and alpha is 0.5, then * specification in a way that allows wallpapers to be
* the window will be drawn in a shade of gray while * seen through a fullscreen window.
* fullscreened.
* *
* By disabling the alpha channel, the window will at * Given that a) the intent of the specification, and
* least be rendered in the intended background color. * b) we don't know what the compositor will do, we
* simply disable transparency while in fullscreen.
*
* To see why, consider what happens if we keep our
* transparency. For example, if the background color
* is white, and alpha is 0.5, then the window will be
* drawn in a shade of gray while fullscreened.
*
* See
* https://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/116
* for a discussion on whether transparent, fullscreen
* windows should be allowed in some way or not.
* *
* NOTE: if changing this, also update render_margin() * NOTE: if changing this, also update render_margin()
*/ */