osc: update font subpixel mode, and window opaque compositor hint, on alpha changes

When background alpha is changed at runtime (using OSC-11), we (may)
have to update the opaque hint we send to the compositor.

We must also update the subpixel mode used when rendering font
glyphs.

Why?

When the window is fully opaque, we use wl_surface_set_opaque_region()
on the entire surface, to hint to the compositor that it doesn’t have
to blend the window content with whatever is behind the
window. Obviously, if alpha is changed from opaque, to transparent (or
semi-transparent), that hint must be removed.

Sub-pixel mode is harder to explain, but in short, we can’t do
subpixel hinting with a (semi-)transparent background. Thus, similar
to the opaque hint, subpixel antialiasing must be enabled/disabled
when background alpha is changed.
This commit is contained in:
Daniel Eklöf 2023-05-25 18:39:32 +02:00
parent 134b54dfe0
commit c51050a9bc
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
5 changed files with 32 additions and 12 deletions

View file

@ -94,6 +94,7 @@ wayl_win_init(struct terminal *term, const char *token)
}
void wayl_win_destroy(struct wl_window *win) {}
void wayl_win_alpha_changed(struct wl_window *win) {}
bool wayl_win_set_urgent(struct wl_window *win) { return true; }
bool