-
-
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
Button example is broken #11235
Comments
Digging into this I can see that Bevy doesn't call
This probably worked before because So the solution is to call I also noticed that Winit has set up a |
This is because If Bevy isn't ready to draw when
If you move the mouse while holding it down it will actually update and show "pressed". This is because changes made to the button are only rendered in the next update cycle, not in the one they are changed in. I'm not sure exactly how the rendering system in Bevy works, but sending So either Bevy has to correctly render the current state in the same call to |
system |
# Objective - Partial fix for #11235 - Fixes #11274 - Fixes #11320 - Fixes #11273 ## Solution - check update mode to trigger redraw request, instead of once a redraw request has been triggered - don't ignore device event in case of `Reactive` update mode - make sure that at least 5 updates are triggered on application start to ensure everything is correctly initialized - trigger manual updates instead of relying on redraw requests when there are no window or they are not visible
I've made a branch to showcase the issue with more logs: https://github.com/mockersf/bevy/tree/one-frame-lag here is the log I get:
so this is causing a one frame lag for every change in the UI. Chances are there is also the same issue with every thing being rendered as the schedules are shared |
Isn't the one frame lag, related to the pipelined renderer ? What you see is the queue_uinodes from the end of the render app of the previous frame, and the extract is from the next update which happens in parallel ? In general, doesn't the pipelined renderer inevitably introduce a one frame delay between events and associated render ? I have done some investigation on my side regarding the Reactive mode case here with the So in ReactiveMode, the This is the best I have been able to go in debugging this, I don't have enough knowledge to really go further for the moment. |
This can no longer be reproduced: closing out. If there's more weirdness (or you want to pursue improvements to Reactive mode), please feel free to open dedicated issues. |
Yup you're right, with pipelined rendering, we need at least two updates to see the result the button example makes it very obvious if you can send exactly one event: clicking the mouse without moving the mouse, or the touchpad not on a Mac laptop (it sends touchpadpressure events) this will impact everything rendered, not just UI we could:
|
I don't like the example being broken, as this is real obvious when using it. Reducing the timeout also means that it increasing consumption even when nothing really happens. I can look into that and provide a PR with this kind of solution during the week-end if we think this is the way to go. |
I was going back to this when I noted that now on main the button example is working as expected on my setup. I have bi-sect the commit that "fixes" it for me to the commit associated to the PR #11660. But as this change still keep For a full fix for the |
#11672 enabled that behavior on all remaining platforms :) |
Unfortunately this is not sufficient to solve the button issue on all platform. I don't have a macos environment, but if I enable the |
#11720 should not block on the main thread if there's not need to, which is most of the time anyway |
# Objective - Change set of systems as I made a mistake in bevyengine#11672 - Don't block main when not needed - Fixes bevyengine#11235 ## Solution - add a run condition so that the system won't run and block main if not needed
What you did
button
example withcargo run --example button
.What went wrong
What I expected
Currently it's basically the inverse.
Additional information
Removing
WinitSettings::desktop_app()
fixes it.This might be related to #11052. Supposedly, the updating mechanisms do not work as expected anymore.
The text was updated successfully, but these errors were encountered: