From 71f03a718d4312589dd7048299ed1f32e740c4fa Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Thu, 1 Oct 2020 00:33:45 +0200 Subject: [PATCH] wayland/actor-surface: Always set opaque region on alpha-less textures Wayland clients using buffers without alpha channel are not expected to set an opaque region. However, we rely on the opaque region for the fast painting path in `MetaShapedTexture`. Thus, make sure to always set an opaque region internally in those cases. For X11 clients, wo do so already. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1463 --- src/wayland/meta-wayland-actor-surface.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/wayland/meta-wayland-actor-surface.c b/src/wayland/meta-wayland-actor-surface.c index ed7c45411..50af540a2 100644 --- a/src/wayland/meta-wayland-actor-surface.c +++ b/src/wayland/meta-wayland-actor-surface.c @@ -225,7 +225,15 @@ meta_wayland_actor_surface_real_sync_actor_state (MetaWaylandActorSurface *actor if (!META_IS_XWAYLAND_SURFACE (surface_role)) { - if (surface->opaque_region) + if (!meta_shaped_texture_has_alpha (stex)) + { + cairo_region_t *opaque_region; + + opaque_region = cairo_region_create_rectangle (&surface_rect); + meta_surface_actor_set_opaque_region (surface_actor, opaque_region); + cairo_region_destroy (opaque_region); + } + else if (surface->opaque_region) { cairo_region_t *opaque_region;