~yerinalexey/stopwatch

e825ccf2edc272b7c6b42e1f22e572e7badb2b5d — Alexey Yerin a month ago 007f3e1 main
Increase poll timeout to 1 second

Reduces flickering on some systems
1 files changed, 6 insertions(+), 7 deletions(-)

M main.ha
M main.ha => main.ha +6 -7
@@ 27,7 27,7 @@ export fn main() void = {
	];

	for (true) {
		match (poll::poll(fds, time::MILLISECOND)) {
		match (poll::poll(fds, time::SECOND)) {
		case uint => void;
		case let err: errors::error =>
			fmt::fatal("Failed to poll: {}", errors::strerror(err));


@@ 35,17 35,16 @@ export fn main() void = {

		ui_tick(&ui);

		if (fds[0].revents & poll::event::POLLIN == 0) {
			match (ui_draw(&ui)) {
		if (fds[0].revents & poll::event::POLLIN != 0) {
			match (ui_handle_input(&ui)) {
			case void => void;
			case quit =>
				break;
			case let err: io::error =>
				fmt::fatal("I/O error: {}", io::strerror(err));
			};
		} else {
			match (ui_handle_input(&ui)) {
			match (ui_draw(&ui)) {
			case void => void;
			case quit =>
				break;
			case let err: io::error =>
				fmt::fatal("I/O error: {}", io::strerror(err));
			};