aboutsummaryrefslogtreecommitdiff
path: root/vis.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2014-09-22 05:46:46 +0200
committerMarc André Tanner <mat@brain-dump.org>2014-09-22 05:46:46 +0200
commitcae527bedaf1641fff25c691524d51b1025a885e (patch)
tree87922683d2a27416a11bd011d469605fac877114 /vis.c
parent54bb11b4bbca0e07f0b743d7d424cf453307e00a (diff)
downloadvis-cae527bedaf1641fff25c691524d51b1025a885e.tar.gz
vis-cae527bedaf1641fff25c691524d51b1025a885e.tar.xz
Make idle timeout configurable per mode
Diffstat (limited to 'vis.c')
-rw-r--r--vis.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/vis.c b/vis.c
index e3ffb45..881ec81 100644
--- a/vis.c
+++ b/vis.c
@@ -74,6 +74,7 @@ struct Mode {
the return value determines whether parent modes will be searched */
void (*input)(const char*, size_t); /* called whenever a key is not found in this mode and all its parent modes */
void (*idle)(void); /* called whenever a certain idle time i.e. without any user input elapsed */
+ time_t idle_timeout; /* idle time in seconds after which the registered function will be called */
};
typedef struct {
@@ -1354,7 +1355,7 @@ int main(int argc, char *argv[]) {
editor_update(vis);
doupdate();
- idle.tv_sec = 3;
+ idle.tv_sec = mode->idle_timeout;
int r = select(1, &fds, NULL, NULL, timeout);
if (r == -1 && errno == EINTR)
continue;