feat(client): add current_scale field to Client and LayerSurface structs

- Add float current_scale to Client struct (HOT section, after corner_radius)
- Add float current_scale to LayerSurface struct (HOT section, after mapped)
- Add config scale range validation [0.25, 4.0] with fprintf warnings
This commit is contained in:
2026-07-05 21:32:22 -04:00
parent 720f3e7136
commit 8b91bc939c
4 changed files with 35 additions and 0 deletions
+6
View File
@@ -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);