android: fix event loop polling (#1638)

* android: poll looper for ControlFlow::Poll and don't exit when no new event received

* Add Android ControlFlow:Poll fix to CHANGELOG
This commit is contained in:
msiglreith 2020-08-12 20:56:28 +02:00 committed by GitHub
parent 05fdcb5b27
commit 68100102be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View file

@ -14,6 +14,7 @@
- On Windows, `set_ime_position` is now a no-op instead of a runtime crash.
- On Android, `set_fullscreen` is now a no-op instead of a runtime crash.
- On iOS and Android, `set_inner_size` is now a no-op instead of a runtime crash.
- On Android, fix `ControlFlow::Poll` not polling the Android event queue.
- **Breaking:** On Web, `set_cursor_position` and `set_cursor_grab` will now always return an error.
- **Breaking:** `PixelDelta` scroll events now return a `PhysicalPosition`.

View file

@ -211,9 +211,7 @@ impl<T: 'static> EventLoop<T> {
);
}
}
None => {
control_flow = ControlFlow::Exit;
}
None => {}
}
call_event_handler!(
@ -258,6 +256,11 @@ impl<T: 'static> EventLoop<T> {
break 'event_loop;
}
ControlFlow::Poll => {
self.first_event = poll(
self.looper
.poll_all_timeout(Duration::from_millis(0))
.unwrap(),
);
self.start_cause = event::StartCause::Poll;
}
ControlFlow::Wait => {