From 8ffc556d441013e06236f144020b91ea4e3a3f86 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Tue, 31 Aug 2021 19:42:22 +0200 Subject: main: verify primary font is monospaced at startup Load a couple of ASCII glyphs and check if their advance widths matches. If not, warn the user that the font is probably not monospaced. This can be disabled by setting tweak.font-monospace-warn=no. Closes #704. --- config.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'config.h') diff --git a/config.h b/config.h index 40daaf3b..6646cca3 100644 --- a/config.h +++ b/config.h @@ -253,6 +253,7 @@ struct config { off_t max_shm_pool_size; float box_drawing_base_thickness; bool box_drawing_solid_shades; + bool font_monospace_warn; } tweak; user_notifications_t notifications; @@ -269,3 +270,6 @@ struct config *config_clone(const struct config *old); bool config_font_parse(const char *pattern, struct config_font *font); void config_font_list_destroy(struct config_font_list *font_list); + +bool check_if_font_is_monospaced( + const char *pattern, user_notifications_t *notifications); -- cgit v1.3 From f39a62fa5e9207a6f8c16066527c68ca9a5524a6 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sun, 5 Sep 2021 09:28:19 +0200 Subject: server: no need to clone the config to handle -N,--no-wait --- config.h | 1 - server.c | 8 ++------ 2 files changed, 2 insertions(+), 7 deletions(-) (limited to 'config.h') diff --git a/config.h b/config.h index 6646cca3..599bc464 100644 --- a/config.h +++ b/config.h @@ -70,7 +70,6 @@ struct config { char *app_id; wchar_t *word_delimiters; bool login_shell; - bool no_wait; bool locked_title; struct { diff --git a/server.c b/server.c index 5144ed17..a5d87b04 100644 --- a/server.c +++ b/server.c @@ -277,16 +277,12 @@ fdm_client(struct fdm *fdm, int fd, int events, void *data) const bool need_to_clone_conf = tll_length(overrides)> 0 || - cdata.hold != server->conf->hold_at_exit || - cdata.no_wait != server->conf->no_wait; + cdata.hold != server->conf->hold_at_exit; struct config *conf = NULL; if (need_to_clone_conf) { conf = config_clone(server->conf); - if (cdata.no_wait != server->conf->no_wait) - conf->no_wait = cdata.no_wait; - if (cdata.hold != server->conf->hold_at_exit) conf->hold_at_exit = cdata.hold; @@ -317,7 +313,7 @@ fdm_client(struct fdm *fdm, int fd, int events, void *data) goto shutdown; } - if (conf != NULL && conf->no_wait) { + if (cdata.no_wait) { // the server owns the instance tll_push_back(server->terminals, instance); client_send_exit_code(client, 0); -- cgit v1.3