diff options
-rw-r--r-- | jouer.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -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: |