mirror of
https://github.com/rust-windowing/winit.git
synced 2026-09-02 06:40:06 -04:00
iOS: Always set timer when polling to avoid slow waking (#2979)
* Always set timer when polling to avoid slow waking * add comment and changelog --------- Co-authored-by: Dusty DeWeese <dustin.deweese@gmail.com> Co-authored-by: Mads Marquart <mads@marquart.dk>
This commit is contained in:
committed by
Kirill Chibisov
parent
3f44eb1fd9
commit
7de2bc7ae6
@@ -8,6 +8,7 @@ And please only add new entries to the top of this list, right below the `# Unre
|
|||||||
|
|
||||||
# Unreleased
|
# Unreleased
|
||||||
|
|
||||||
|
- On iOS, always wake the event loop when transitioning from `ControlFlow::Poll` to `ControlFlow::Poll`.
|
||||||
- **Breaking:** `ActivationTokenDone` event which could be requested with the new `startup_notify` module, see its docs for more.
|
- **Breaking:** `ActivationTokenDone` event which could be requested with the new `startup_notify` module, see its docs for more.
|
||||||
- On Wayland, make double clicking and moving the CSD frame more reliable.
|
- On Wayland, make double clicking and moving the CSD frame more reliable.
|
||||||
- On macOS, add tabbing APIs on `WindowExtMacOS` and `EventLoopWindowTargetExtMacOS`.
|
- On macOS, add tabbing APIs on `WindowExtMacOS` and `EventLoopWindowTargetExtMacOS`.
|
||||||
|
|||||||
@@ -393,9 +393,6 @@ impl AppState {
|
|||||||
|
|
||||||
let new = self.control_flow;
|
let new = self.control_flow;
|
||||||
match (old, new) {
|
match (old, new) {
|
||||||
(ControlFlow::Poll, ControlFlow::Poll) => self.set_state(AppStateImpl::PollFinished {
|
|
||||||
waiting_event_handler,
|
|
||||||
}),
|
|
||||||
(ControlFlow::Wait, ControlFlow::Wait) => {
|
(ControlFlow::Wait, ControlFlow::Wait) => {
|
||||||
let start = Instant::now();
|
let start = Instant::now();
|
||||||
self.set_state(AppStateImpl::Waiting {
|
self.set_state(AppStateImpl::Waiting {
|
||||||
@@ -428,6 +425,7 @@ impl AppState {
|
|||||||
});
|
});
|
||||||
self.waker.start_at(new_instant)
|
self.waker.start_at(new_instant)
|
||||||
}
|
}
|
||||||
|
// Unlike on macOS, handle Poll to Poll transition here to call the waker
|
||||||
(_, ControlFlow::Poll) => {
|
(_, ControlFlow::Poll) => {
|
||||||
self.set_state(AppStateImpl::PollFinished {
|
self.set_state(AppStateImpl::PollFinished {
|
||||||
waiting_event_handler,
|
waiting_event_handler,
|
||||||
|
|||||||
Reference in New Issue
Block a user