From 737167955e8347ce06718e7a8324c9d2ac89dfba Mon Sep 17 00:00:00 2001 From: Federico Angelilli Date: Thu, 28 Nov 2024 01:09:40 +0100 Subject: Refactor actions --- src/config.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/config.c') diff --git a/src/config.c b/src/config.c index e7c47d7..ea59761 100644 --- a/src/config.c +++ b/src/config.c @@ -49,7 +49,7 @@ const config_entry_t block_entries[] = { { "min-width", CONFIG_UINT, NULL, offsetof(block_t, min_width) }, { "max-width", CONFIG_UINT, NULL, offsetof(block_t, max_width) }, { "interval", CONFIG_TIME, NULL, offsetof(block_t, update_interval) }, - //{ "trigger", CONFIG_STRING, NULL, offsetof(block_t, actions[EVENT_TRIGGER]) }, + { "trigger", CONFIG_STRING, NULL, offsetof(block_t, actions[EVENT_TRIGGER]) }, { "left-click", CONFIG_STRING, NULL, offsetof(block_t, actions[EVENT_LEFT_CLICK]) }, { "middle-click", CONFIG_STRING, NULL, offsetof(block_t, actions[EVENT_MIDDLE_CLICK]) }, { "right-click", CONFIG_STRING, NULL, offsetof(block_t, actions[EVENT_RIGHT_CLICK]) }, @@ -205,7 +205,7 @@ static bool config_read_color(const char *value, color_t *result) static bool config_read_gradient(const char *value, gradient_t *result) { - gradient_free(result); + gradient_clean(result); memset(result, 0, sizeof(gradient_t)); size_t count = 0; @@ -762,7 +762,6 @@ bool config_resolve_action(config_t *config, const char *label, action_t **actio } } - log_error("Action '%s' not found", label); return false; } @@ -798,11 +797,11 @@ void config_free(config_t *config) free(config->blocks); for (size_t i = 0; i < config->n_actions; i++) - action_free(&config->actions[i]); + action_clean(&config->actions[i]); free(config->actions); - gradient_free(&config->background); + gradient_clean(&config->background); free(config->font); free(config->monitor); free(config->wm_name); -- cgit v1.2.3