summaryrefslogtreecommitdiffstats
path: root/menu.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2022-09-19 18:41:48 +0800
committerKevin McCarthy <kevin@8t8.us>2022-10-08 12:37:58 -0700
commit925a292766f32afadd1496871964348223657335 (patch)
tree15475471002fd8ccca325d525534005b2211caee /menu.c
parente43a42bfdbdbd968f15dbdf00bf6c04bedcf1ca3 (diff)
Move SigWinch handling before refresh in menus.
This will prevent an unneeded double-refresh after an endwin() when we set SigWinch in the next commit. In the pager, change RETWINCH handling to account for a sigwinch while in the handler. Previously a redraw would occur and use/free the Resize data, but since the SigWinch check now occurs before the redraw, keep existing data.
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/menu.c b/menu.c
index 52198f9a..f83356c4 100644
--- a/menu.c
+++ b/menu.c
@@ -1047,6 +1047,20 @@ int mutt_menuLoop (MUTTMENU *menu)
mutt_curs_set (0);
+#if defined (USE_SLANG_CURSES) || defined (HAVE_RESIZETERM)
+ if (SigWinch)
+ {
+ do
+ {
+ SigWinch = 0;
+ mutt_resize_screen ();
+ }
+ while (SigWinch);
+
+ clearok(stdscr,TRUE);/*force complete redraw*/
+ }
+#endif
+
if (menu->custom_menu_update)
menu->custom_menu_update (menu);
@@ -1074,16 +1088,6 @@ int mutt_menuLoop (MUTTMENU *menu)
mutt_refresh ();
-#if defined (USE_SLANG_CURSES) || defined (HAVE_RESIZETERM)
- if (SigWinch)
- {
- SigWinch = 0;
- mutt_resize_screen ();
- clearok(stdscr,TRUE);/*force complete redraw*/
- continue;
- }
-#endif
-
/* try to catch dialog keys before ops */
if (menu->dialog && menu_dialog_dokey (menu, &i) == 0)
return i;