summaryrefslogtreecommitdiffstats
path: root/curs_main.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2019-10-17 15:48:31 +0800
committerKevin McCarthy <kevin@8t8.us>2019-10-17 15:48:31 +0800
commita327386c5bf676a8321335fca849159ddd664ab9 (patch)
treec71712b5d43836f99bc5917e51875ffaef3c9490 /curs_main.c
parent937a1eb12570f5daf598359fa490ccfde1ca0daf (diff)
Stable branch quick fix for pager change-mailbox push/exec bug.
The menu functions mutt_push/pop_current_menu() keep track of the menu stack, automatically setting CurrentMenu when exiting menus. The only gotcha was the function sharing between the index and pager menus. The index uses a hack, setting menu->menu to MENU_PAGER for operations redirecting through the index and back to the pager afterwards. I thought this was covered by the restoration of the menu before returning to the pager, or when exiting the index switch. However it is not: invoking other menus, such as the browser, will result in CurrentMenu being set to the Pager when exiting those (by mutt_pop_current_menu()). This can result in folder hooks failing for unshared functions. A better fix is to remove the hack of using menu->menu, because this can easily cause a problem in the future in other situations. (I will make this fix in master next.) For the stable branch, I am explicitly setting/restoring CurrentMenu before invoking the folder hooks.
Diffstat (limited to 'curs_main.c')
-rw-r--r--curs_main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/curs_main.c b/curs_main.c
index 32925f29..d57ce985 100644
--- a/curs_main.c
+++ b/curs_main.c
@@ -1371,6 +1371,9 @@ int mutt_index_menu (void)
mutt_sleep (0);
+ /* XXX: quick fix in stable branch. Better fix will be in master */
+ CurrentMenu = MENU_MAIN;
+
/* Note that menu->menu may be MENU_PAGER if the change folder
* operation originated from the pager.
*