summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
Diffstat (limited to 'video')
-rw-r--r--video/out/vo_wayland.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/video/out/vo_wayland.c b/video/out/vo_wayland.c
index f6c68a8e73..9871503b81 100644
--- a/video/out/vo_wayland.c
+++ b/video/out/vo_wayland.c
@@ -393,6 +393,16 @@ static bool resize(struct priv *p)
wl->window.width = p->dst_w;
wl->window.height = p->dst_h;
+ // if no alpha enabled format is used then create an opaque region to allow
+ // the compositor to optimize the drawing of the window
+ if (!p->enable_alpha) {
+ struct wl_region *opaque =
+ wl_compositor_create_region(wl->display.compositor);
+ wl_region_add(opaque, 0, 0, p->dst_w, p->dst_h);
+ wl_surface_set_opaque_region(wl->window.surface, opaque);
+ wl_region_destroy(opaque);
+ }
+
// a redraw should happen at this point
wl_surface_attach(wl->window.surface, p->front_buffer->wlbuf, x, y);
wl_surface_damage(wl->window.surface, 0, 0, p->dst_w, p->dst_h);