From baca61df68e636bffd1b35be955e1182d1534c5c Mon Sep 17 00:00:00 2001 From: Levi Neely <141506390+lneely@users.noreply.github.com> Date: Wed, 13 May 2026 16:55:45 +0200 Subject: [PATCH] Fix menu title bar: implement frame_buf resize in window_resize MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The menu frame was created at 1x1 and resized via wFrameWindowResize which calls window_resize. But wl_window_resize didn't handle frame_bufs — it only handled toplevel views. Now it reallocates the pixman image when dimensions change, so the frame has the correct size when wl_frame_paint renders the title bar. --- src/backend/wayland/wl_backend.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/backend/wayland/wl_backend.c b/src/backend/wayland/wl_backend.c index 740f042..b317d67 100644 --- a/src/backend/wayland/wl_backend.c +++ b/src/backend/wayland/wl_backend.c @@ -3693,7 +3693,7 @@ wl_frame_paint(struct WFrameWindow *fwin) { struct wl_frame_buf *fb = frame_buf_find(fwin->core->window); if (!fb || !fb->image) - return 0; /* not our frame — shouldn't happen */ + return 0; int state = fwin->flags.state; int total_w = fb->width; @@ -5439,7 +5439,15 @@ static void wl_window_resize(WNativeWindow win, int w, int h) wlr_xdg_surface_schedule_configure(v->xdg_surface); return; } - /* Frame buffer resize is handled by frame_configure. */ + struct wl_frame_buf *fb = frame_buf_find(win); + if (fb && w > 0 && h > 0 && (w != fb->width || h != fb->height)) { + pixman_image_unref(fb->image); + fb->image = pixman_image_create_bits(PIXMAN_a8r8g8b8, w, h, NULL, 0); + fb->width = w; + fb->height = h; + fb->base.width = w; + fb->base.height = h; + } } static void wl_window_set_border(WNativeWindow win, unsigned long pixel) {