diff options
| author | Federico Angelilli <code@fedang.net> | 2024-11-24 23:00:33 +0100 |
|---|---|---|
| committer | Federico Angelilli <code@fedang.net> | 2024-11-24 23:00:33 +0100 |
| commit | 7ed39aca6d07b8ca69c0373f5623ffd6a5564412 (patch) | |
| tree | b640cf38ade176b6c1ad22608fed87dc83b18c63 /src/event.c | |
| parent | b5c06f76b9a7cbc64590ec247778704459efb3ea (diff) | |
Add other actions to config
Diffstat (limited to 'src/event.c')
| -rw-r--r-- | src/event.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/event.c b/src/event.c index 0e7efe3..45ec809 100644 --- a/src/event.c +++ b/src/event.c @@ -9,7 +9,7 @@ const char *event_type_to_string(event_type_t type) { - const char *types[EVENT_LENGTH] = { + const char *types[EVENT_MAX] = { "trigger", "left_click", "middle_click", @@ -21,7 +21,7 @@ const char *event_type_to_string(event_type_t type) "hover_stop", }; - assert(type >= EVENT_TRIGGER && type < EVENT_LENGTH); + assert(type >= EVENT_TRIGGER && type < EVENT_MAX); return types[type]; } @@ -81,8 +81,8 @@ static void event_dispatch_callback(event_state_t *state, layout_t *layout, even "b:action", layout->block->actions != NULL, "b:callback", event_fn != NULL); - if (event_is_click(event) && layout->block->actions != NULL) { - action_perform(layout->block->actions, layout->block, state->config); + if (layout->block->actions[event.type] != NULL) { + action_perform(layout->block->actions[event.type], layout->block, state->config); } if (event_fn != NULL) { |
