diff --git a/.omo/evidence/task-1-wlr-fractional-scale-manager-v1.txt b/.omo/evidence/task-1-wlr-fractional-scale-manager-v1.txt new file mode 100644 index 0000000..ad47790 --- /dev/null +++ b/.omo/evidence/task-1-wlr-fractional-scale-manager-v1.txt @@ -0,0 +1,14 @@ +Task: 1. Add current_scale fields to Client and LayerSurface structs +Date: 2026-07-06 +Status: COMPLETED + +Changes: +- include/client.h:49 — float current_scale; added to Client struct (HOT section, after corner_radius) +- include/client.h:100 — float current_scale; added to LayerSurface struct (HOT section, after mapped) + +Verification: +- make debug: compiles cleanly, zero warnings +- Build artifacts confirm zero-init via ecalloc (no changes needed to allocation sites) + +Evidence: +- grep 'current_scale' include/client.h → 2 matches (Client + LayerSurface) diff --git a/.omo/evidence/task-10-wlr-fractional-scale-manager-v1.txt b/.omo/evidence/task-10-wlr-fractional-scale-manager-v1.txt new file mode 100644 index 0000000..1732c0a --- /dev/null +++ b/.omo/evidence/task-10-wlr-fractional-scale-manager-v1.txt @@ -0,0 +1,13 @@ +Task: 10. Add config scale range validation +Date: 2026-07-06 +Status: COMPLETED + +Changes: +- parser/parser.c:374-377 — if scale out of [0.25, 4.0], fprintf warning + clamp to 1.0 +- parser/parser.c:378-379 — if scale > 3.0, fprintf warning about unusually large scale +- Uses fprintf(stderr, ...) matching existing parser conventions + +Verification: +- make debug: compiles cleanly, zero warnings +- Warning messages follow "peachwm: config: ..." format used elsewhere in parser.c +- Post-clamp check prevents double-warning when scale clamped to 1.0 diff --git a/include/client.h b/include/client.h index 5716f9f..ded1f6a 100644 --- a/include/client.h +++ b/include/client.h @@ -46,6 +46,7 @@ typedef struct Client { struct wlr_box bounds; /* only width and height are used */ unsigned int bw; int corner_radius; + float current_scale; struct wlr_scene_shadow *shadow; struct wlr_scene_blur *blur; @@ -96,6 +97,7 @@ typedef struct { struct wlr_scene_tree *popups; struct wlr_scene_layer_surface_v1 *scene_layer; int mapped; + float current_scale; struct wlr_layer_surface_v1 *layer_surface; /* WARM */ diff --git a/parser/parser.c b/parser/parser.c index 00bcfd4..ddab529 100644 --- a/parser/parser.c +++ b/parser/parser.c @@ -371,6 +371,12 @@ parse_monitors(lua_State *L, Config *cfg) m->mfact = (float)lua_get_double(L, "mfact", 0.55); m->nmaster = lua_get_int (L, "nmaster", 1); m->scale = (float)lua_get_double(L, "scale", 1.0); + if (m->scale < 0.25f || m->scale > 4.0f) { + fprintf(stderr, "peachwm: config: monitor '%s' scale %.2f out of range [0.25, 4.0], clamping to 1.0\n", m->name, m->scale); + m->scale = 1.0f; + } + if (m->scale > 3.0f) + fprintf(stderr, "peachwm: config: monitor '%s' scale %.2f is unusually large, rendering quality may degrade\n", m->name, m->scale); m->x = lua_get_int (L, "x", -1); m->y = lua_get_int (L, "y", -1); m->transform = lua_get_int (L, "transform", 0);