terminal: fswait3 returns fd count on timeout; fix cursor blinks
This commit is contained in:
parent
18389b62c7
commit
b8d297e86d
@ -1194,21 +1194,20 @@ int main(int argc, char ** argv) {
|
||||
while (!exit_application) {
|
||||
|
||||
int res[] = {0,0,0,0};
|
||||
int index = fswait3(amfd == -1 ? 3 : 4,fds,200,res);
|
||||
fswait3(amfd == -1 ? 3 : 4,fds,200,res);
|
||||
|
||||
check_for_exit();
|
||||
|
||||
if (input_stopped) continue;
|
||||
|
||||
maybe_flip_cursor();
|
||||
if (res[0]) {
|
||||
maybe_flip_cursor();
|
||||
int r = read(fd_master, buf, BUF_SIZE);
|
||||
for (int i = 0; i < r; ++i) {
|
||||
ansi_put(ansi_state, buf[i]);
|
||||
}
|
||||
}
|
||||
if (res[1]) {
|
||||
maybe_flip_cursor();
|
||||
int r = read(kfd, buf, BUF_SIZE);
|
||||
for (int i = 0; i < r; ++i) {
|
||||
int ret = kbd_scancode(&kbd_state, buf[i], &event);
|
||||
@ -1234,9 +1233,6 @@ int main(int argc, char ** argv) {
|
||||
handle_mouse_abs(&packet);
|
||||
}
|
||||
}
|
||||
if (index < 0) {
|
||||
maybe_flip_cursor();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2373,14 +2373,14 @@ int main(int argc, char ** argv) {
|
||||
|
||||
/* Wait for something to happen. */
|
||||
int res[] = {0,0};
|
||||
int index = fswait3(2,fds,200,res);
|
||||
fswait3(2,fds,200,res);
|
||||
|
||||
/* Check if the child application has closed. */
|
||||
check_for_exit();
|
||||
maybe_flip_cursor();
|
||||
|
||||
if (res[1]) {
|
||||
/* Read from PTY */
|
||||
maybe_flip_cursor();
|
||||
int r = read(fd_master, buf, 4096);
|
||||
for (int i = 0; i < r; ++i) {
|
||||
ansi_put(ansi_state, buf[i]);
|
||||
@ -2389,13 +2389,8 @@ int main(int argc, char ** argv) {
|
||||
}
|
||||
if (res[0]) {
|
||||
/* Handle Yutani events. */
|
||||
maybe_flip_cursor();
|
||||
handle_incoming();
|
||||
}
|
||||
if (index < 0) {
|
||||
/* Timeout, flip the cursor. */
|
||||
maybe_flip_cursor();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user