diff --git a/gdk/wayland/gdksubsurface-wayland.c b/gdk/wayland/gdksubsurface-wayland.c index ba37326806..407976a96d 100644 --- a/gdk/wayland/gdksubsurface-wayland.c +++ b/gdk/wayland/gdksubsurface-wayland.c @@ -491,9 +491,6 @@ gdk_wayland_subsurface_attach (GdkSubsurface *sub, has_background = self->bg_rect.width > 0 && self->bg_rect.height > 0; - if (has_background) - ensure_bg_surface (self); - if (!scaled_rect_is_integral (dest, 1, &device_rect)) { GDK_DISPLAY_DEBUG (gdk_surface_get_display (sub->parent), OFFLOAD, @@ -669,6 +666,8 @@ gdk_wayland_subsurface_attach (GdkSubsurface *sub, if (has_background) { + ensure_bg_surface (self); + if (background_changed) { wl_subsurface_set_position (self->bg_subsurface, self->bg_rect.x, self->bg_rect.y);