wayland: Refuse offloading when we can't

If we have a subsurface with background, but no single-pixel
buffer support, refuse to offload.
This commit is contained in:
Matthias Clasen 2024-04-15 11:11:39 -04:00
parent 0c67b367ac
commit fbe000734a

View File

@ -311,6 +311,7 @@ gdk_wayland_subsurface_attach (GdkSubsurface *sub,
{
GdkWaylandSubsurface *self = GDK_WAYLAND_SUBSURFACE (sub);
GdkWaylandSurface *parent = GDK_WAYLAND_SURFACE (sub->parent);
GdkWaylandDisplay *display = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (sub->parent));
struct wl_buffer *buffer = NULL;
gboolean result = FALSE;
GdkWaylandSubsurface *sib = sibling ? GDK_WAYLAND_SUBSURFACE (sibling) : NULL;
@ -457,6 +458,12 @@ gdk_wayland_subsurface_attach (GdkSubsurface *sub,
gdk_texture_get_height (texture),
self);
}
else if (has_background && !display->single_pixel_buffer)
{
GDK_DISPLAY_DEBUG (gdk_surface_get_display (sub->parent), OFFLOAD,
"Cannot offload subsurface %p with background, no single-pixel buffer support",
self);
}
else
{
gboolean was_transparent;