From 6ecdeca3fcee4b816a12e247f12166172173069f Mon Sep 17 00:00:00 2001 From: Window Maker Date: Sun, 24 May 2026 14:44:26 +0200 Subject: [PATCH] wl_backend: fix background not updating on first apply Two issues: 1. bg_image scene node wasn't re-enabled when switching from solid color back to an image background 2. No frame was scheduled after background change, so the compositor wouldn't repaint until the next natural frame tick Now explicitly enables the bg_image node and calls wlr_output_schedule_frame() after any background change. --- src/backend/wayland/wl_backend.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/backend/wayland/wl_backend.c b/src/backend/wayland/wl_backend.c index 5982a7b..0707e50 100644 --- a/src/backend/wayland/wl_backend.c +++ b/src/backend/wayland/wl_backend.c @@ -7735,6 +7735,8 @@ static void wl_set_desktop_background(WScreen *scr, const char *texture_desc) if (wl_state.bg_image) wlr_scene_node_set_enabled(&wl_state.bg_image->node, false); } + if (wl_state.output) + wlr_output_schedule_frame(wl_state.output); WMReleasePropList(texpl); return; } else if ((strcasecmp(type, "vgradient") == 0 || @@ -7917,6 +7919,7 @@ static void wl_set_desktop_background(WScreen *scr, const char *texture_desc) /* Replace or create the background scene buffer */ if (wl_state.bg_image) { wlr_scene_buffer_set_buffer(wl_state.bg_image, &buf->base); + wlr_scene_node_set_enabled(&wl_state.bg_image->node, true); } else { wl_state.bg_image = wlr_scene_buffer_create( wl_state.level_trees[WL_LAYER_BACKGROUND], &buf->base); @@ -7926,6 +7929,10 @@ static void wl_set_desktop_background(WScreen *scr, const char *texture_desc) if (wl_state.bg_wlr_buf) wlr_buffer_drop(wl_state.bg_wlr_buf); wl_state.bg_wlr_buf = &buf->base; + + /* Schedule a frame to display the new background immediately */ + if (wl_state.output) + wlr_output_schedule_frame(wl_state.output); } /* ------------------------------------------------------------------ */