From 2d5c80f332b04b57492a126ced40fc246e18afcd Mon Sep 17 00:00:00 2001 From: Ollie Date: Sat, 23 May 2026 19:26:06 +0200 Subject: [PATCH] wl_backend: fix resizebar texture and client frame_rel update on resize 1. Resizebar: wl_frame_paint_resizebar was painting a flat color buffer over the textured resizebar rendered by wl_frame_paint. Make it a no-op since the parent frame buffer has the correct texture. 2. Resize gap: client_synth_configure updates the client scene_node position but was not updating frame_rel_x/y. When frame_configure ran next (e.g. on subsequent move), it would recompute the client position using stale frame_rel values, causing the surface to jump. Now updates frame_rel_x/y from the new absolute position. --- src/backend/wayland/wl_backend.c | 36 ++++++++++---------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/src/backend/wayland/wl_backend.c b/src/backend/wayland/wl_backend.c index f095ad1..d862b93 100644 --- a/src/backend/wayland/wl_backend.c +++ b/src/backend/wayland/wl_backend.c @@ -6904,6 +6904,14 @@ wl_client_synth_configure(WNativeWindow client_win, /* Phase 18: keep scene node in sync. */ if (v->scene_node) wlr_scene_node_set_position(&v->scene_node->node, x, y); + /* Update relative offset so frame_configure keeps us in sync. */ + if (v->frame_id) { + struct wl_frame_buf *pfb = frame_buf_find(v->frame_id); + if (pfb) { + v->frame_rel_x = x - pfb->x; + v->frame_rel_y = y - pfb->y; + } + } if (v->xw_surface) { wlr_xwayland_surface_configure(v->xw_surface, (int16_t)x, (int16_t)y, @@ -8519,31 +8527,9 @@ static unsigned long wl_keysym_from_name(const char *name) static void wl_frame_paint_resizebar(WFrameWindow *fwin) { - if (!fwin->resizebar || !fwin->resizebar->window) - return; - struct wl_frame_buf *fb = frame_buf_find((WNativeWindow)fwin->resizebar->window); - if (!fb || !fb->image) - return; - - uint32_t *dst = (uint32_t *)pixman_image_get_data(fb->image); - int stride = pixman_image_get_stride(fb->image) / 4; - uint32_t bg = 0xFFAEAAAE; - uint32_t light = 0xFFDDDDDD; - uint32_t dark = 0xFF555555; - - /* Fill background */ - for (int row = 0; row < fb->height; row++) - for (int col = 0; col < fb->width; col++) - dst[row * stride + col] = bg; - /* Top highlight */ - for (int col = 0; col < fb->width; col++) - dst[col] = light; - /* Bottom shadow */ - if (fb->height > 1) - for (int col = 0; col < fb->width; col++) - dst[(fb->height - 1) * stride + col] = dark; - - wlr_scene_buffer_set_buffer(fb->scene_buf, &fb->base); + /* Resizebar is rendered into the parent frame buffer by wl_frame_paint. + * Don't commit a separate buffer here — it would overlay the texture. */ + (void)fwin; } static void wl_frame_paint_titlebar(WFrameWindow *fwin, int state)