Commit 0182dc85 authored by Kevin J. McCarthy's avatar Kevin J. McCarthy

Change direct mutt_getch() callers to handle new mail event.

The inotify handler now returns -2 (timeout) on a new mail event.
Change the direct callers to ignore, so prompts aren't strangely
aborted.

Also, fix mutt_change_flag() to call mutt_refresh() before the
prompt.  Apparently ncurses getch() was doing this for us, but now
that we are polling STDIN instead, the prompt wasn't displaying.
parent f495b84d
Pipeline #23111834 passed with stages
in 15 minutes and 4 seconds
......@@ -932,7 +932,10 @@ int _mutt_enter_fname (const char *prompt, char *buf, size_t blen, int buffy, in
mutt_window_clrtoeol (MuttMessageWindow);
mutt_refresh ();
ch = mutt_getch();
do
{
ch = mutt_getch();
} while (ch.ch == -2);
if (ch.ch < 0)
{
mutt_window_clearline (MuttMessageWindow, 0);
......
......@@ -703,7 +703,10 @@ int _mutt_enter_string (char *buf, size_t buflen, int col,
{
event_t event;
/*ADDCH (LastKey);*/
event = mutt_getch ();
do
{
event = mutt_getch ();
} while (event.ch == -2);
if (event.ch >= 0)
{
LastKey = event.ch;
......
......@@ -346,8 +346,12 @@ int mutt_change_flag (HEADER *h, int bf)
mutt_window_mvprintw (MuttMessageWindow, 0, 0,
"%s? (D/N/O/r/*/!): ", bf ? _("Set flag") : _("Clear flag"));
mutt_window_clrtoeol (MuttMessageWindow);
mutt_refresh ();
event = mutt_getch();
do
{
event = mutt_getch();
} while (event.ch == -2);
i = event.ch;
if (i < 0)
{
......
......@@ -917,7 +917,10 @@ static int menu_dialog_dokey (MUTTMENU *menu, int *ip)
event_t ch;
char *p;
ch = mutt_getch ();
do
{
ch = mutt_getch();
} while (ch.ch == -2);
if (ch.ch < 0)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment