Fix menu title bar: implement frame_buf resize in window_resize
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.
This commit is contained in:
parent
40a10a0785
commit
baca61df68
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue