diff options
Diffstat (limited to 'video/out/wayland_common.c')
-rw-r--r-- | video/out/wayland_common.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index ecea6fedeb..2d9e63a17d 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -1612,6 +1612,20 @@ int vo_wayland_control(struct vo *vo, int *events, int request, void *arg) return VO_NOTIMPL; } +void vo_wayland_set_opaque_region(struct vo_wayland_state *wl, int alpha) +{ + const int32_t width = wl->scaling * mp_rect_w(wl->geometry); + const int32_t height = wl->scaling * mp_rect_h(wl->geometry); + if (!alpha) { + struct wl_region *region = wl_compositor_create_region(wl->compositor); + wl_region_add(region, 0, 0, width, height); + wl_surface_set_opaque_region(wl->surface, region); + wl_region_destroy(region); + } else { + wl_surface_set_opaque_region(wl->surface, NULL); + } +} + void vo_wayland_sync_clear(struct vo_wayland_state *wl) { struct vo_wayland_sync sync = {0, 0, 0, 0}; |