summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jouer.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/jouer.c b/jouer.c
index 1d14e0f..70795a8 100644
--- a/jouer.c
+++ b/jouer.c
@@ -80,7 +80,6 @@ enum action_state_t dig_entry(const struct entry_t *entries, int cnt_entries, st
switch (event.key.keysym.sym) {
case SDLK_a:
case SDLK_ESCAPE:
- update_list_entries(params->surfaces, params->positions, NULL, 0, -1);
return ACTION_CANCELED;
case SDLK_k:
case SDLK_UP:
@@ -96,11 +95,14 @@ enum action_state_t dig_entry(const struct entry_t *entries, int cnt_entries, st
case SDLK_RETURN:
target = &entries[selection];
if (!target->children_cnt) {
- return target->f(params->surfaces, params->positions, params->t1, params->t2, target->data);
- }
+ enum action_state_t state = target->f(params->surfaces, params->positions, params->t1, params->t2, target->data);
- if (dig_entry(target->children, target->children_cnt, params) == ACTION_PERFORMED)
- return ACTION_PERFORMED;
+ if (state == ACTION_PERFORMED)
+ return ACTION_PERFORMED;
+ } else {
+ if (dig_entry(target->children, target->children_cnt, params) == ACTION_PERFORMED)
+ return ACTION_PERFORMED;
+ }
update_list_entries(params->surfaces, params->positions, entries, cnt_entries, selection);
default: