render: OSD: don’t mark surface as being opaque, when it’s not

This commit is contained in:
Daniel Eklöf 2023-07-19 16:39:56 +02:00
parent 899b768b74
commit a49281ced3
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 10 additions and 6 deletions

View file

@ -1953,12 +1953,15 @@ render_osd(struct terminal *term, const struct wayl_sub_surface *sub_surf,
wl_surface_attach(sub_surf->surface.surf, buf->wl_buf, 0, 0);
wl_surface_damage_buffer(sub_surf->surface.surf, 0, 0, buf->width, buf->height);
struct wl_region *region = wl_compositor_create_region(term->wl->compositor);
if (region != NULL) {
wl_region_add(region, 0, 0, buf->width, buf->height);
wl_surface_set_opaque_region(sub_surf->surface.surf, region);
wl_region_destroy(region);
}
if (alpha == 0xffff) {
struct wl_region *region = wl_compositor_create_region(term->wl->compositor);
if (region != NULL) {
wl_region_add(region, 0, 0, buf->width, buf->height);
wl_surface_set_opaque_region(sub_surf->surface.surf, region);
wl_region_destroy(region);
}
} else
wl_surface_set_opaque_region(sub_surf->surface.surf, NULL);
wl_surface_commit(sub_surf->surface.surf);
quirk_weston_subsurface_desync_off(sub_surf->sub);