config: drop all warning logs from the tweak section

This commit is contained in:
Daniel Eklöf 2021-11-06 13:44:50 +01:00
parent 1f39c46c17
commit d4b9ef7607
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 19 additions and 53 deletions

View file

@ -2308,9 +2308,6 @@ parse_section_tweak(struct context *ctx)
{ {
struct config *conf = ctx->conf; struct config *conf = ctx->conf;
const char *key = ctx->key; const char *key = ctx->key;
const char *value = ctx->value;
const char *path = ctx->path;
unsigned lineno = ctx->lineno;
if (strcmp(key, "scaling-filter") == 0) { if (strcmp(key, "scaling-filter") == 0) {
static const char *filters[] = { static const char *filters[] = {
@ -2325,25 +2322,14 @@ parse_section_tweak(struct context *ctx)
_Static_assert(sizeof(conf->tweak.fcft_filter) == sizeof(int), _Static_assert(sizeof(conf->tweak.fcft_filter) == sizeof(int),
"enum is not 32-bit"); "enum is not 32-bit");
if (!value_to_enum(ctx, filters, (int *)&conf->tweak.fcft_filter)) return value_to_enum(ctx, filters, (int *)&conf->tweak.fcft_filter);
return false;
LOG_WARN("tweak: scaling-filter=%s", filters[conf->tweak.fcft_filter]);
} }
else if (strcmp(key, "overflowing-glyphs") == 0) { else if (strcmp(key, "overflowing-glyphs") == 0)
if (!value_to_bool(ctx, &conf->tweak.overflowing_glyphs)) return value_to_bool(ctx, &conf->tweak.overflowing_glyphs);
return false;
if (!conf->tweak.overflowing_glyphs)
LOG_WARN("tweak: disabled overflowing glyphs");
}
else if (strcmp(key, "damage-whole-window") == 0) { else if (strcmp(key, "damage-whole-window") == 0)
if (!value_to_bool(ctx, &conf->tweak.damage_whole_window)) return value_to_bool(ctx, &conf->tweak.damage_whole_window);
return false;
if (conf->tweak.damage_whole_window)
LOG_WARN("tweak: damage whole window");
}
else if (strcmp(key, "grapheme-shaping") == 0) { else if (strcmp(key, "grapheme-shaping") == 0) {
if (!value_to_bool(ctx, &conf->tweak.grapheme_shaping)) if (!value_to_bool(ctx, &conf->tweak.grapheme_shaping))
@ -2365,23 +2351,17 @@ parse_section_tweak(struct context *ctx)
* grapheme-clustering at least */ * grapheme-clustering at least */
} }
if (!conf->tweak.grapheme_shaping) return true;
LOG_WARN("tweak: grapheme shaping disabled");
} }
else if (strcmp(key, "grapheme-width-method") == 0) { else if (strcmp(key, "grapheme-width-method") == 0) {
_Static_assert(sizeof(conf->tweak.grapheme_width_method) == sizeof(int), _Static_assert(sizeof(conf->tweak.grapheme_width_method) == sizeof(int),
"enum is not 32-bit"); "enum is not 32-bit");
if (!value_to_enum( return value_to_enum(
ctx, ctx,
(const char *[]){"wcswidth", "double-width", NULL}, (const char *[]){"wcswidth", "double-width", NULL},
(int *)&conf->tweak.grapheme_width_method)) (int *)&conf->tweak.grapheme_width_method);
{
return false;
}
LOG_WARN("%s:%d [tweak].grapheme-width-method=%s", path, lineno, value);
} }
else if (strcmp(key, "render-timer") == 0) { else if (strcmp(key, "render-timer") == 0) {
@ -2431,7 +2411,7 @@ parse_section_tweak(struct context *ctx)
} }
conf->tweak.delayed_render_lower_ns = ns; conf->tweak.delayed_render_lower_ns = ns;
LOG_WARN("tweak: delayed-render-lower=%u", ns); return true;
} }
else if (strcmp(key, "delayed-render-upper") == 0) { else if (strcmp(key, "delayed-render-upper") == 0) {
@ -2445,7 +2425,7 @@ parse_section_tweak(struct context *ctx)
} }
conf->tweak.delayed_render_upper_ns = ns; conf->tweak.delayed_render_upper_ns = ns;
LOG_WARN("tweak: delayed-render-upper=%u", ns); return true;
} }
else if (strcmp(key, "max-shm-pool-size-mb") == 0) { else if (strcmp(key, "max-shm-pool-size-mb") == 0) {
@ -2454,26 +2434,14 @@ parse_section_tweak(struct context *ctx)
return false; return false;
conf->tweak.max_shm_pool_size = min((int32_t)mb * 1024 * 1024, INT32_MAX); conf->tweak.max_shm_pool_size = min((int32_t)mb * 1024 * 1024, INT32_MAX);
LOG_WARN("tweak: max-shm-pool-size=%lld bytes", return true;
(long long)conf->tweak.max_shm_pool_size);
} }
else if (strcmp(key, "box-drawing-base-thickness") == 0) { else if (strcmp(key, "box-drawing-base-thickness") == 0)
if (!value_to_double(ctx, &conf->tweak.box_drawing_base_thickness)) return value_to_double(ctx, &conf->tweak.box_drawing_base_thickness);
return false;
LOG_WARN("tweak: box-drawing-base-thickness=%f", else if (strcmp(key, "box-drawing-solid-shades") == 0)
conf->tweak.box_drawing_base_thickness); return value_to_bool(ctx, &conf->tweak.box_drawing_solid_shades);
}
else if (strcmp(key, "box-drawing-solid-shades") == 0) {
if (!value_to_bool(ctx, &conf->tweak.box_drawing_solid_shades))
return false;
if (!conf->tweak.box_drawing_solid_shades)
LOG_WARN("tweak: box-drawing-solid-shades=%s",
conf->tweak.box_drawing_solid_shades ? "yes" : "no");
}
else if (strcmp(key, "font-monospace-warn") == 0) else if (strcmp(key, "font-monospace-warn") == 0)
return value_to_bool(ctx, &conf->tweak.font_monospace_warn); return value_to_bool(ctx, &conf->tweak.font_monospace_warn);
@ -2483,7 +2451,7 @@ parse_section_tweak(struct context *ctx)
return false; return false;
} }
return true; UNREACHABLE();
} }
static bool static bool

View file

@ -894,9 +894,7 @@ This section is for advanced users and describes configuration options
that can be used to tweak foot's low-level behavior. that can be used to tweak foot's low-level behavior.
These options are *not* included in the example configuration. You These options are *not* included in the example configuration. You
should not change these unless you understand what they do and note should not change these unless you understand what they do.
that changing the default values *will* print a warning when launching
foot.
Note that these options may change, or be removed at any time, without Note that these options may change, or be removed at any time, without
prior notice. prior notice.