-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: upgrade to winit v0.30 #13366
fix: upgrade to winit v0.30 #13366
Conversation
Does anyone have opinions on squeezing this into 0.14 vs merging it at the start of 0.15? On the one hand fixes are great, on the other hand these upgrade PRs are consistently incredibly painful to review and introduce a large number of new bugs that must be manually tested. |
IMHO, this could be finished and merged as part of 0.14: I only moved code from free variables and functions inside the WinitAppRunnerState, not really changing any logic. Also, apart from testing it, the number of missing/required changes is not high: I just need to understand better the AccessKit part, restore the exit flags (that aren't currently working) and compile/test the various platforms. The low_power example (and I believe others too) in MacOS works already. |
I think android support is broken without the update. See this message from Francois #13254 (comment) |
Could you give me more details on the iOS build failure? I don't see it in CI, I'll try to reproduce tomorrow also, another patch update please: Sophya#7 |
Seems like iOS is skipped? This happened last time it was added to the merge queue: https://github.com/bevyengine/bevy/actions/runs/9215755498/job/25354702941 |
FYI: this fixes an issue on |
Oh wow, just tested and this is extremely noticeable on one of my apps running in debug mode. I was wondering yesterday how it could possibly feel so sluggish. Huge fix! I am seeing an issue however around startup where there is some rescaling visible. Screen.Recording.2024-06-02.at.9.39.46.AM.movIn this video it's pretty instant but it's seemed to hang just a bit longer a few times. |
@pietrosophya once you commit the changes suggested in #13366 (comment) to fix the iOS build I'll merge this in. |
I think it has also been happening to me on Wayland. Oh wow.
Sophya#7 is also still waiting. |
It appears the issue is not completely fixed, there are still frames where inputs are missing, but it is measureably improved. |
Co-authored-by: François Mockers <[email protected]>
update patch
Patch #7 applied, and also accepted/reverted the change for building iOS |
…raits" (#13414) # Objective - #13347 was good actually ## Solution - Add it back to main (once #13366 is merged) --------- Co-authored-by: Alice Cecile <[email protected]>
Thank you to everyone involved with the authoring or reviewing of this PR! This work is relatively important and needs release notes! Head over to bevyengine/bevy-website#1328 if you'd like to help out. |
- Upgrade winit to v0.30 - Fixes bevyengine#13331 This is a rewrite/adaptation of the new trait system described and implemented in `winit` v0.30. The custom UserEvent is now renamed as WakeUp, used to wake up the loop if anything happens outside the app (a new [custom_user_event](https://github.com/bevyengine/bevy/pull/13366/files#diff-2de8c0a8d3028d0059a3d80ae31b2bbc1cde2595ce2d317ea378fe3e0cf6ef2d) shows this behavior. The internal `UpdateState` has been removed and replaced internally by the AppLifecycle. When changed, the AppLifecycle is sent as an event. The `UpdateMode` now accepts only two values: `Continuous` and `Reactive`, but the latter exposes 3 new properties to enable reactive to device, user or window events. The previous `UpdateMode::Reactive` is now equivalent to `UpdateMode::reactive()`, while `UpdateMode::ReactiveLowPower` to `UpdateMode::reactive_low_power()`. The `ApplicationLifecycle` has been renamed as `AppLifecycle`, and now contains the possible values of the application state inside the event loop: * `Idle`: the loop has not started yet * `Running` (previously called `Started`): the loop is running * `WillSuspend`: the loop is going to be suspended * `Suspended`: the loop is suspended * `WillResume`: the loop is going to be resumed Note: the `Resumed` state has been removed since the resumed app is just running. Finally, now that `winit` enables this, it extends the `WinitPlugin` to support custom events. - [x] Windows - [x] MacOs - [x] Linux (x11) - [x] Linux (Wayland) - [x] Android - [x] iOS - [x] WASM/WebGPU - [x] WASM/WebGL2 - [ ] iOS: build failed in CI - blocking, but may just be flakiness - [x] Cross-platform: when the window is maximised, changes in the scale factor don't apply, to make them apply one has to make the window smaller again. (Re-maximising keeps the updated scale factor) - non-blocking, but good to fix - [ ] Android: it's pretty easy to quickly open and close the app and then the music keeps playing when suspended. - non-blocking but worrying - [ ] Web: the application will hang when switching tabs - Not new, duplicate of bevyengine#13486 - [ ] Cross-platform?: Screenshot failure, `ERROR present_frames: wgpu_core::present: No work has been submitted for this frame before` taking the first screenshot, but after pressing space - non-blocking, but good to fix --------- Co-authored-by: François <[email protected]>
…raits" (bevyengine#13414) # Objective - bevyengine#13347 was good actually ## Solution - Add it back to main (once bevyengine#13366 is merged) --------- Co-authored-by: Alice Cecile <[email protected]>
I'm in the process of migrating my custom rendering backend to work with Bevy 0.14 and I'm running into trouble because the |
…raits" (bevyengine#13414) # Objective - bevyengine#13347 was good actually ## Solution - Add it back to main (once bevyengine#13366 is merged) --------- Co-authored-by: Alice Cecile <[email protected]>
Objective
Solution
This is a rewrite/adaptation of the new trait system described and implemented in
winit
v0.30.Migration Guide
The custom UserEvent is now renamed as WakeUp, used to wake up the loop if anything happens outside the app (a new custom_user_event shows this behavior.
The internal
UpdateState
has been removed and replaced internally by the AppLifecycle. When changed, the AppLifecycle is sent as an event.The
UpdateMode
now accepts only two values:Continuous
andReactive
, but the latter exposes 3 new properties to enable reactive to device, user or window events. The previousUpdateMode::Reactive
is now equivalent toUpdateMode::reactive()
, whileUpdateMode::ReactiveLowPower
toUpdateMode::reactive_low_power()
.The
ApplicationLifecycle
has been renamed asAppLifecycle
, and now contains the possible values of the application state inside the event loop:Idle
: the loop has not started yetRunning
(previously calledStarted
): the loop is runningWillSuspend
: the loop is going to be suspendedSuspended
: the loop is suspendedWillResume
: the loop is going to be resumedNote: the
Resumed
state has been removed since the resumed app is just running.Finally, now that
winit
enables this, it extends theWinitPlugin
to support custom events.Test platforms
Outstanding issues / regressions
winit::TabLeft
/Event::Suspended
doesn't function as intended on WASM #13486ERROR present_frames: wgpu_core::present: No work has been submitted for this frame before
taking the first screenshot, but after pressing space