From 4b0d17b33263cf7d3491ce15160b05e5a14dfc41 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 21 Apr 2024 11:54:57 -0400 Subject: [PATCH] wayland: Fix an offload cornercase Treat textures with background as opaque for the purposes of offloading. --- gdk/wayland/gdksubsurface-wayland.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdk/wayland/gdksubsurface-wayland.c b/gdk/wayland/gdksubsurface-wayland.c index eaf5b72e8b..2b43950983 100644 --- a/gdk/wayland/gdksubsurface-wayland.c +++ b/gdk/wayland/gdksubsurface-wayland.c @@ -450,7 +450,8 @@ gdk_wayland_subsurface_attach (GdkSubsurface *sub, self); } else if (!will_be_above && - gdk_memory_format_alpha (gdk_texture_get_format (texture)) != GDK_MEMORY_ALPHA_OPAQUE) + gdk_memory_format_alpha (gdk_texture_get_format (texture)) != GDK_MEMORY_ALPHA_OPAQUE && + !has_background) { GDK_DISPLAY_DEBUG (gdk_surface_get_display (sub->parent), OFFLOAD, "Cannot offload non-opaque %dx%d texture below, hiding subsurface %p",