]> granicus.if.org Git - neomutt/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)
committerRichard Russon <rich@flatcap.org>
Mon, 3 Sep 2018 01:04:32 +0000 (02:04 +0100)
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 961928674e95dcf35b074c3e30f900fa911721a4..fac01c5d205fa839a43ecacc71bdefac690b1fe4 100644 (file)
@@ -575,7 +575,10 @@ int mutt_enter_fname_full(const char *prompt, char *buf, size_t buflen, bool mai
   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 47974ba015e5bfa3a48fd704df711b14889a5bc6..813966f32a4b64f2f2cca14485151f1668a4920a 100644 (file)
--- a/enter.c
+++ b/enter.c
@@ -681,7 +681,10 @@ int mutt_enter_string_full(char *buf, size_t buflen, int col, int flags, bool mu
         case OP_EDITOR_QUOTE_CHAR:
         {
           struct Event event;
-          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 479c785f64308ae8e91330cbe936cf4e7532e8cb..f90c1a370dbbfc97854f6d34fddb18024818b120 100644 (file)
--- a/flags.c
+++ b/flags.c
@@ -431,8 +431,12 @@ int mutt_change_flag(struct 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 2a2ef281b2e783532e646b7be23b26f442bd67cb..0db9260868d9262126e71ed9001e30fe0f3810db 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -1248,7 +1248,10 @@ static int menu_dialog_dokey(struct Menu *menu, int *ip)
   struct Event ch;
   char *p = NULL;
 
-  ch = mutt_getch();
+  do
+  {
+    ch = mutt_getch();
+  } while (ch.ch == -2);
 
   if (ch.ch < 0)
   {