From dac0b4fa6fcf73f80ddd5ca68458c166192000b5 Mon Sep 17 00:00:00 2001 From: HuntedByTheIRS Date: Sun, 5 Jul 2026 21:46:42 -0400 Subject: [PATCH] fix(monitor): update surface scale on monitor migration and config reload MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add client_update_scale() in setmon() after c->mon assignment - Add client + layer surface scale iteration in reapply_monitor_config() - Verify outputmgrapplyortest→updatemons propagation chain (no changes needed) --- src/peachwm.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/peachwm.c b/src/peachwm.c index beb2755..041d0cf 100644 --- a/src/peachwm.c +++ b/src/peachwm.c @@ -3162,9 +3162,10 @@ static void setmon(Client *c, Monitor *m, uint32_t newtags) { if (oldmon == m) return; c->mon = m; - c->prev = c->geom; + c->prev = c->geom; + client_update_scale(c); - /* Scene graph sends surface leave/enter events on move and resize */ + /* Scene graph sends surface leave/enter events on move and resize */ if (oldmon) arrange(oldmon); if (m) { @@ -3311,6 +3312,20 @@ reapply_monitor_config(void) wlr_output_state_set_transform(&state, r->transform); wlr_output_commit_state(m->wlr_output, &state); wlr_output_state_finish(&state); + /* Re-notify surfaces on this monitor of new scale */ + { + Client *c; + wl_list_for_each(c, &clients, link) { + if (c->mon == m) + client_update_scale(c); + } + for (int i = 0; i < 4; i++) { + LayerSurface *l; + wl_list_for_each(l, &m->layers[i], link) { + layersurface_update_scale(l); + } + } + } /* Update position */ if (r->x != -1 && r->y != -1) wlr_output_layout_add(output_layout, m->wlr_output, r->x, r->y);