mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
wayland: window: optimize: set opaque region
When background alpha is 1.0 (0xffff), i.e. completely opaque, tell the compositor this, via wl_surface_set_opaque_region(). This allows it to optimize drawing of surfaces _behind_ our window.
This commit is contained in:
parent
ce4e99ebe2
commit
1178a7763b
1 changed files with 11 additions and 0 deletions
11
wayland.c
11
wayland.c
|
|
@ -850,6 +850,17 @@ wayl_win_init(struct terminal *term)
|
|||
goto out;
|
||||
}
|
||||
|
||||
if (term->colors.alpha == 0xffff) {
|
||||
struct wl_region *region = wl_compositor_create_region(
|
||||
term->wl->compositor);
|
||||
|
||||
if (region != NULL) {
|
||||
wl_region_add(region, 0, 0, INT32_MAX, INT32_MAX);
|
||||
wl_surface_set_opaque_region(win->surface, region);
|
||||
wl_region_destroy(region);
|
||||
}
|
||||
}
|
||||
|
||||
wl_surface_add_listener(win->surface, &surface_listener, win);
|
||||
|
||||
win->xdg_surface = xdg_wm_base_get_xdg_surface(wayl->shell, win->surface);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue