From 3975feb1980c73061dc7100df8099f8a77be23a8 Mon Sep 17 00:00:00 2001 From: maxjivi05 Date: Mon, 30 Nov 2026 20:43:22 -0500 Subject: [PATCH] fix(compositor): clear stale viewport destination on buffer resize --- app/src/main/cpp/waylandcomp/src/compositor.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/src/main/cpp/waylandcomp/src/compositor.c b/app/src/main/cpp/waylandcomp/src/compositor.c index 03f33894cb..8f4fb2980d 100644 --- a/app/src/main/cpp/waylandcomp/src/compositor.c +++ b/app/src/main/cpp/waylandcomp/src/compositor.c @@ -1000,6 +1000,11 @@ static void take_shm(struct surface *s, struct wl_shm_buffer *shm, struct wl_res s->buf_alpha = wl_shm_buffer_get_format(shm) == WL_SHM_FORMAT_ARGB8888; s->black_fill = 0; s->has_content = s->shm_img != NULL; + if (s->dst_set && !s->src_set && (s->dst[0] != w || s->dst[1] != h)) { + s->dst_set = 0; + s->dst[0] = -1; + s->dst[1] = -1; + } g_stat_shm++; struct client_info *ci = client_info_of(wl_resource_get_client(s->resource)); if (ci && ci->asked_feedback) ci->shm_frames++; @@ -1083,6 +1088,11 @@ static void take_dmabuf(struct surface *s, struct dmabuf_buffer *b, struct wl_re s->buf_h = b->height; s->buf_alpha = (b->format & 0xff) == 'A'; s->has_content = b->img != NULL; + if (s->dst_set && !s->src_set && (s->dst[0] != b->width || s->dst[1] != b->height)) { + s->dst_set = 0; + s->dst[0] = -1; + s->dst[1] = -1; + } if (!repeat) g_stat_dmabuf++; const int announced_now = !s->announced_vulkan; if (!s->announced_vulkan) {