static size_t UngetLen = 0;
static struct Event *UngetKeyEvents;
+int MuttGetchTimeout = -1;
+
/**
* mutt_refresh - Force a refresh of the screen
*/
*/
void mutt_getch_timeout(int delay)
{
+ MuttGetchTimeout = delay;
timeout(delay);
-#ifdef USE_INOTIFY
- mutt_monitor_set_poll_timeout(delay);
-#endif
}
#ifdef USE_INOTIFY
* we need to make sure there isn't a character waiting */
timeout(0);
int ch = getch();
- timeout(mutt_monitor_get_poll_timeout());
+ timeout(MuttGetchTimeout);
if (ch == ERR)
{
if (mutt_monitor_poll() != 0)
/* These Config Variables are only used in curs_lib.c */
extern bool MetaKey; /**< interpret ALT-x as ESC-x */
+extern int MuttGetchTimeout;
+
/* For mutt_simple_format() justifications */
#define FMT_LEFT -1
#define FMT_CENTER 0
#include "mutt/mutt.h"
#include "monitor.h"
#include "context.h"
+#include "curs_lib.h"
#include "globals.h"
#include "mailbox.h"
#include "mutt_curses.h"
static size_t PollFdsCount = 0;
static size_t PollFdsLen = 0;
static struct pollfd *PollFds;
-static int PollTimeout = -1;
struct MonitorInfo
{
return new_descr;
}
-void mutt_monitor_set_poll_timeout(int timeout)
-{
- PollTimeout = timeout;
-}
-
-int mutt_monitor_get_poll_timeout(void)
-{
- return PollTimeout;
-}
-
#define EVENT_BUFLEN MAX(4096, sizeof(struct inotify_event) + NAME_MAX + 1)
/* mutt_monitor_poll: Waits for I/O ready file descriptors or signals.
if (INotifyFd != -1)
{
- fds = poll(PollFds, PollFdsLen, PollTimeout);
+ fds = poll(PollFds, PollFdsLen, MuttGetchTimeout);
if (fds == -1)
{
int mutt_monitor_add(struct Mailbox *b);
int mutt_monitor_remove(struct Mailbox *b);
-void mutt_monitor_set_poll_timeout(int timeout);
-int mutt_monitor_get_poll_timeout(void);
int mutt_monitor_poll(void);
#endif /* _MUTT_MONITOR_H */