From a94b0ecde01d021795c6c29a90d60a45f9198e2d Mon Sep 17 00:00:00 2001 From: Lars Henriksen Date: Mon, 20 Aug 2018 20:22:24 +0200 Subject: Fix window update after hook execution The introduction of hooks raised a problem with window updates. The diagnosis in commit feb059e8 (Fix segmentation fault on reload with pre-load hook) was right, the cure was wrong. The problem is wins_update(), not the listbox contents. The wins_update() call does not belong in wins_unprepare_external() (or in io_reload_data()), but at a higher level. It should be called _after_ reload, as indeed it is in key_generic_reload() when the listbox contents have been updated (todo as well as appointments). The call was introduced in commit 8ae75f3 without comment. The todo updates in io_reload_data() also belong in key_generic_reload() where they were before commit 7f06c252. When saving data, all panels must be updated in case a hook was executed. Signed-off-by: Lars Henriksen Signed-off-by: Lukas Fleischer --- src/io.c | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'src/io.c') diff --git a/src/io.c b/src/io.c index 56783b0..9fb9434 100644 --- a/src/io.c +++ b/src/io.c @@ -935,7 +935,6 @@ int io_reload_data(void) case 3: /* FALLTHROUGH */ default: - wins_update(FLAG_STA); goto cleanup; } } @@ -961,20 +960,10 @@ int io_reload_data(void) recur_event_llist_init(); todo_init_list(); - /* - * Temporarily reinitialize the todo list box without any items to make - * sure wins_unprepare_external() does not fail when it is called after - * executing the pre-load hook. - */ - ui_todo_load_items(); - ui_todo_sel_reset(); - io_load_data(NULL); run_hook("post-load"); io_unset_modified(); - ui_todo_load_items(); - ui_todo_sel_reset(); if (show_dialogs()) { status_mesg(reload_success, enter); -- cgit v1.2.3-54-g00ecf