]> granicus.if.org Git - mutt/commitdiff
Change direct mutt_getch() callers to handle new mail event.
authorKevin McCarthy <kevin@8t8.us>
Sun, 3 Jun 2018 21:05:13 +0000 (14:05 -0700)
committerKevin McCarthy <kevin@8t8.us>
Sun, 3 Jun 2018 21:05:13 +0000 (14:05 -0700)
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.

curs_lib.c
enter.c
flags.c
menu.c

index 85d29688975a631c3fb1a766e4bc82e745a83653..a8635e5953152628b3851e135c445d05cfa9fe2a 100644 (file)
@@ -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);
diff --git a/enter.c b/enter.c
index f1fb746cf0a98473e27f0323098bdd0af199f26e..c134091a46a6981950ee33c78f05594e7ccbea1c 100644 (file)
--- a/enter.c
+++ b/enter.c
@@ -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;
diff --git a/flags.c b/flags.c
index 489694b0b95aff6d5de36029747f3b08a7d65125..51fabcbfdac384dc13a363229584d6af9d478798 100644 (file)
--- a/flags.c
+++ b/flags.c
@@ -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)
   {
diff --git a/menu.c b/menu.c
index dfd8fa75aa20fd29090a909f84129a2c2ed899e1..dd7fad03e3ceb08b1de8e235c6f4ef9682cc4af2 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -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)
   {