From 938f30ee927059dbc972ec567643ff6d752d0fa7 Mon Sep 17 00:00:00 2001 From: wreald Date: Sat, 31 May 2025 15:42:29 +1000 Subject: [PATCH] Reload colors2 as well as colors, naming tweaks. --- config.c | 1 + main.c | 4 ++-- server.c | 8 ++++++-- server.h | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/config.c b/config.c index c65d0a39..8b16b9de 100644 --- a/config.c +++ b/config.c @@ -3872,6 +3872,7 @@ config_reload_colors(struct config *conf) // loading the config? conf->colors = new_conf.colors; + conf->colors2 = new_conf.colors2; config_free(&new_conf); } diff --git a/main.c b/main.c index d0f25f9b..4940f4d5 100644 --- a/main.c +++ b/main.c @@ -48,14 +48,14 @@ fdm_sigint(struct fdm *fdm, int signo, void *data) static bool fdm_sigusr1_server(struct fdm *fdm, int signo, void *data) { - server_hard_reload_config_colors(data); + server_reload_config_colors(data); return true; } static bool fdm_sigusr1_term(struct fdm *fdm, int signo, void *data) { - term_hard_reload_config_colors(data); + term_reload_config_colors(data); return true; } diff --git a/server.c b/server.c index 40a92d43..14cc3f02 100644 --- a/server.c +++ b/server.c @@ -593,7 +593,7 @@ err: /* Reload configured colors from disk. */ void -server_hard_reload_config_colors(struct server *server) { +server_reload_config_colors(struct server *server) { config_reload_colors((struct config *)server->conf); tll_foreach(server->wayl->terms, it) { @@ -601,7 +601,11 @@ server_hard_reload_config_colors(struct server *server) { ((struct config *)term->conf)->colors = server->conf->colors; - term_soft_reload_config_colors(term); + if (term->colors.active_theme == COLOR_THEME1) { + term_theme_apply(term, &term->conf->colors); + } else { + term_theme_apply(term, &term->conf->colors2); + } } } diff --git a/server.h b/server.h index 7eae2aa0..3612ef34 100644 --- a/server.h +++ b/server.h @@ -9,4 +9,4 @@ struct server; struct server *server_init(const struct config *conf, struct fdm *fdm, struct reaper *reaper, struct wayland *wayl); void server_destroy(struct server *server); -void server_hard_reload_config_colors(struct server *server); +void server_reload_config_colors(struct server *server);