fix(core/binding): 将 action_arg 改为值类型避免悬空指针问题

This commit is contained in:
2026-04-27 01:17:07 +08:00
parent c93e78bbd6
commit fc038eda35
6 changed files with 7 additions and 7 deletions

View File

@@ -59,7 +59,7 @@ bool config_defaults_build(
auto default_mode = api->add_mode(builder, "default");
#define BIND(mode, key, fn, arg) \
api->bind(builder, mode, key, fn, &(zdwm_action_arg_t)arg)
api->bind(builder, mode, key, fn, (zdwm_action_arg_t)arg)
BIND(default_mode, "Mod4+r", spawn, {.str = launcher});

View File

@@ -161,7 +161,7 @@ static bool runtime_config_bind(
zdwm_binding_mode_id_t mode,
const char *key,
zdwm_action_fn fn,
zdwm_action_arg_t *arg
zdwm_action_arg_t arg
) {
return binding_table_add_bind(builder->binding_table, mode, key, fn, arg);
}