From b60545bdc6a820112b04dbe8b54d93816efa5a05 Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Mon, 5 Oct 2020 10:28:37 -0500 Subject: wayland: update opaque region on runtime Made possible with 00b9c81. 34b8adc let the wayland surface set an opaque region depending on if alpha was set by the user or not. However, there was no attempted detection for runtime changes and it is possible (at least in wayland vulkan) to toggle the alpha on and off. So this meant, we could be incorrectly signalling an opaque region if the user happened to change the alpha. Additionally, add a helper function for this and use it everywhere we want to set the opaque region. --- video/out/vo_wlshm.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'video/out/vo_wlshm.c') diff --git a/video/out/vo_wlshm.c b/video/out/vo_wlshm.c index a517d0f09d..dbfa386789 100644 --- a/video/out/vo_wlshm.c +++ b/video/out/vo_wlshm.c @@ -201,11 +201,7 @@ static int resize(struct vo *vo) const int32_t height = wl->scaling * mp_rect_h(wl->geometry); struct buffer *buf; - 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); - + vo_wayland_set_opaque_region(wl, 0); vo->want_redraw = true; vo->dwidth = width; vo->dheight = height; -- cgit v1.2.3