wayland: use set_buffer_with_damage for all in-place paints

wlr_scene_buffer_set_buffer treats same-pointer assignment as a
no-op — pixel updates to fb->image are not picked up.  Every paint
function in the backend mutates fb->image (or s->wlr_buf) in place
and then commits with the same pointer, so wlroots never re-rendered
the changed contents.

Convert all 15 sites to wlr_scene_buffer_set_buffer_with_damage(...,
NULL) which forces a full rerender.  This restores the menu paint
fix to its proper general form and addresses the clip workspace
number/title not appearing at startup, as well as latent staleness
in dock/drawer icon and balloon paint paths.
This commit is contained in:
Window Maker 2026-05-24 08:13:57 +02:00
parent e973406d95
commit 31576e4b25
1 changed files with 15 additions and 15 deletions

View File

@ -4469,7 +4469,7 @@ wl_frame_paint(struct WFrameWindow *fwin)
/* Commit titlebar buffer */
if (tb_fb && tb_fb->scene_buf) {
wlr_scene_buffer_set_buffer(tb_fb->scene_buf, &tb_fb->base);
wlr_scene_buffer_set_buffer_with_damage(tb_fb->scene_buf, &tb_fb->base, NULL);
}
}
@ -4545,7 +4545,7 @@ wl_frame_paint(struct WFrameWindow *fwin)
if (fb->scene_buf) {
if (show_resizebar) {
wlr_scene_node_set_enabled(&fb->scene_buf->node, true);
wlr_scene_buffer_set_buffer(fb->scene_buf, &fb->base);
wlr_scene_buffer_set_buffer_with_damage(fb->scene_buf, &fb->base, NULL);
} else {
wlr_scene_node_set_enabled(&fb->scene_buf->node, false);
}
@ -6049,7 +6049,7 @@ overlay_flush(void)
/* Ensure the node is visible for the animation frame. */
wlr_scene_node_set_enabled(&s->scene_buf->node, true);
/* Notify wlroots that the pixel data has changed. */
wlr_scene_buffer_set_buffer(s->scene_buf, &s->wlr_buf);
wlr_scene_buffer_set_buffer_with_damage(s->scene_buf, &s->wlr_buf, NULL);
}
/* Commit the scene immediately so the animation step is visible
* before the caller's wusleep() delay. */
@ -6668,7 +6668,7 @@ static void wl_window_set_background_pixmap(WNativeWindow win, unsigned long pix
src_w < pixman_image_get_width(dst_img) ? src_w : pixman_image_get_width(dst_img),
src_h < pixman_image_get_height(dst_img) ? src_h : pixman_image_get_height(dst_img));
if (fb)
wlr_scene_buffer_set_buffer(fb->scene_buf, &fb->base);
wlr_scene_buffer_set_buffer_with_damage(fb->scene_buf, &fb->base, NULL);
}
static void wl_pixmap_free(unsigned long pixmap)
@ -6700,7 +6700,7 @@ static void wl_window_clear(WNativeWindow win)
/* Notify the scene buffer of the update */
if (fb)
wlr_scene_buffer_set_buffer(fb->scene_buf, &fb->base);
wlr_scene_buffer_set_buffer_with_damage(fb->scene_buf, &fb->base, NULL);
}
static int
@ -7000,7 +7000,7 @@ void wl_view_commit_backing_impl(unsigned long id)
{
struct wl_frame_buf *fb = frame_buf_find((WNativeWindow)id);
if (fb && fb->scene_buf) {
wlr_scene_buffer_set_buffer(fb->scene_buf, &fb->base);
wlr_scene_buffer_set_buffer_with_damage(fb->scene_buf, &fb->base, NULL);
/* Enable the node — it has content now */
wlr_scene_node_set_enabled(&fb->scene_buf->node, true);
}
@ -7545,7 +7545,7 @@ wl_workspace_badge_render(WScreen *scr, WNativeWindow badge_win,
/* Update scene buffer */
if (fb->scene_buf)
wlr_scene_buffer_set_buffer(fb->scene_buf, &fb->base);
wlr_scene_buffer_set_buffer_with_damage(fb->scene_buf, &fb->base, NULL);
/* Return RImage copy for fade animation */
RImage *result = RCreateImage(width, height, False);
@ -7598,7 +7598,7 @@ wl_workspace_badge_update(WScreen *scr, WNativeWindow badge_win, RImage *img)
}
if (fb->scene_buf)
wlr_scene_buffer_set_buffer(fb->scene_buf, &fb->base);
wlr_scene_buffer_set_buffer_with_damage(fb->scene_buf, &fb->base, NULL);
if (wl_state.output)
wlr_output_schedule_frame(wl_state.output);
}
@ -7933,7 +7933,7 @@ static void wl_frame_paint_button(WCoreWindow *button, WTexture *texture,
}
/* Enable and commit the button's own scene_buf */
wlr_scene_buffer_set_buffer(btn_fb->scene_buf, &btn_fb->base);
wlr_scene_buffer_set_buffer_with_damage(btn_fb->scene_buf, &btn_fb->base, NULL);
wlr_scene_node_set_enabled(&btn_fb->scene_buf->node, true);
wlr_scene_node_raise_to_top(&btn_fb->scene_buf->node);
}
@ -8166,7 +8166,7 @@ wl_icon_paint(WIcon *icon)
}
/* --- Commit to scene graph --- */
wlr_scene_buffer_set_buffer(fb->scene_buf, &fb->base);
wlr_scene_buffer_set_buffer_with_damage(fb->scene_buf, &fb->base, NULL);
wlr_scene_node_set_enabled(&fb->scene_buf->node, true);
if (fb->tree)
wlr_scene_node_set_enabled(&fb->tree->node, true);
@ -8247,7 +8247,7 @@ static void wl_appicon_paint(WAppIcon *aicon)
RReleaseImage(tile);
/* Commit to scene graph */
wlr_scene_buffer_set_buffer(fb->scene_buf, &fb->base);
wlr_scene_buffer_set_buffer_with_damage(fb->scene_buf, &fb->base, NULL);
wlr_scene_node_set_enabled(&fb->scene_buf->node, true);
}
static void wl_noop_restore_desktop(WScreen *scr) { (void)scr; }
@ -8435,7 +8435,7 @@ static void wl_clip_icon_paint(WAppIcon *aicon)
}
/* Commit updated buffer */
wlr_scene_buffer_set_buffer(fb->scene_buf, &fb->base);
wlr_scene_buffer_set_buffer_with_damage(fb->scene_buf, &fb->base, NULL);
}
static void wl_drawer_icon_paint(WAppIcon *aicon)
{
@ -8493,7 +8493,7 @@ static void wl_drawer_icon_paint(WAppIcon *aicon)
}
}
wlr_scene_buffer_set_buffer(fb->scene_buf, &fb->base);
wlr_scene_buffer_set_buffer_with_damage(fb->scene_buf, &fb->base, NULL);
}
static void wl_balloon_init(WScreen *scr)
{
@ -8722,7 +8722,7 @@ static void wl_frame_paint_titlebar(WFrameWindow *fwin, int state)
wfree(title);
}
wlr_scene_buffer_set_buffer(fb->scene_buf, &fb->base);
wlr_scene_buffer_set_buffer_with_damage(fb->scene_buf, &fb->base, NULL);
}
static WNativeWindow wl_noop_prop_get_client_leader(WNativeWindow window) { (void)window; return WNATIVE_NONE; }
@ -8845,7 +8845,7 @@ static void wl_balloon_show(WScreen *scr, void *bal_ptr)
if (fb->scene_buf) {
wlr_scene_node_set_position(&fb->scene_buf->node, bx, by);
wlr_scene_buffer_set_buffer(fb->scene_buf, &fb->base);
wlr_scene_buffer_set_buffer_with_damage(fb->scene_buf, &fb->base, NULL);
wlr_scene_node_set_enabled(&fb->tree->node, true);
}