diff options
author | Thomas Graf <tgraf@suug.ch> | 2016-08-02 12:05:29 +0200 |
---|---|---|
committer | Thomas Graf <tgraf@suug.ch> | 2016-08-02 12:05:29 +0200 |
commit | 7317715e157027d103abfd31337a0337112c77f0 (patch) | |
tree | 0e6b46f2b88142adbfe5643c7269b942f1bba307 | |
parent | 86f6da070300b94d0cad96b000675403d0915dd4 (diff) |
Fix item selection after element subgroups have been removed
If the element currently selected is removed due to inactivity, the
selection is fixed up to the previous element in the list. This step
must be done after the entire element subgroup has been removed.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
-rw-r--r-- | src/element.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/element.c b/src/element.c index ebddc2e..32917db 100644 --- a/src/element.c +++ b/src/element.c @@ -201,12 +201,6 @@ void element_free(struct element *e) struct attr *a, *an; int i; - if (e->e_group->g_current == e) { - element_select_prev(); - if (e->e_group->g_current == e) - e->e_group->g_current = NULL; - } - list_for_each_entry_safe(c, cnext, &e->e_childs, e_list) element_free(c); @@ -221,6 +215,12 @@ void element_free(struct element *e) list_for_each_entry_safe(a, an, &e->e_attrhash[i], a_list) attr_free(a); + if (e->e_group->g_current == e) { + element_select_prev(); + if (e->e_group->g_current == e) + e->e_group->g_current = NULL; + } + list_del(&e->e_list); e->e_group->g_nelements--; |