From: Andre Noll Date: Mon, 25 Mar 2013 02:14:06 +0000 (+0000) Subject: gui: Check stdin for readability. X-Git-Tag: v0.4.13~33^2~10 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=d7562ba640e30ac4bf1160509f4c2f705363d53f gui: Check stdin for readability. If the select_loop of para_gui runs in getch or command mode we currently wait a full timeout period before checking for pending input. This patch adds stdin to the set of file descriptors monitored by select so that a key press causes select() to return immediately. --- diff --git a/gui.c b/gui.c index 728fb9b7..9ac24ab6 100644 --- a/gui.c +++ b/gui.c @@ -993,6 +993,8 @@ repeat: if (command_fds[1] >= 0) para_fd_set(command_fds[1], &rfds, &max_fileno); } + if (mode == GETCH_MODE || mode == COMMAND_MODE) + para_fd_set(STDIN_FILENO, &rfds, &max_fileno); ret = para_select(max_fileno + 1, &rfds, NULL, &tv); if (ret <= 0) goto check_return; /* skip fd checks */