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:
@@ -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)
|
||||||
@@ -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
|
||||||
@@ -46,6 +46,7 @@ typedef struct Client {
|
|||||||
struct wlr_box bounds; /* only width and height are used */
|
struct wlr_box bounds; /* only width and height are used */
|
||||||
unsigned int bw;
|
unsigned int bw;
|
||||||
int corner_radius;
|
int corner_radius;
|
||||||
|
float current_scale;
|
||||||
struct wlr_scene_shadow *shadow;
|
struct wlr_scene_shadow *shadow;
|
||||||
struct wlr_scene_blur *blur;
|
struct wlr_scene_blur *blur;
|
||||||
|
|
||||||
@@ -96,6 +97,7 @@ typedef struct {
|
|||||||
struct wlr_scene_tree *popups;
|
struct wlr_scene_tree *popups;
|
||||||
struct wlr_scene_layer_surface_v1 *scene_layer;
|
struct wlr_scene_layer_surface_v1 *scene_layer;
|
||||||
int mapped;
|
int mapped;
|
||||||
|
float current_scale;
|
||||||
struct wlr_layer_surface_v1 *layer_surface;
|
struct wlr_layer_surface_v1 *layer_surface;
|
||||||
|
|
||||||
/* WARM */
|
/* WARM */
|
||||||
|
|||||||
@@ -371,6 +371,12 @@ parse_monitors(lua_State *L, Config *cfg)
|
|||||||
m->mfact = (float)lua_get_double(L, "mfact", 0.55);
|
m->mfact = (float)lua_get_double(L, "mfact", 0.55);
|
||||||
m->nmaster = lua_get_int (L, "nmaster", 1);
|
m->nmaster = lua_get_int (L, "nmaster", 1);
|
||||||
m->scale = (float)lua_get_double(L, "scale", 1.0);
|
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->x = lua_get_int (L, "x", -1);
|
||||||
m->y = lua_get_int (L, "y", -1);
|
m->y = lua_get_int (L, "y", -1);
|
||||||
m->transform = lua_get_int (L, "transform", 0);
|
m->transform = lua_get_int (L, "transform", 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user