Fix Reactive and ReactiveLowPower update modes#11325
Fix Reactive and ReactiveLowPower update modes#11325alice-i-cecile merged 5 commits intobevyengine:mainfrom
Conversation
14b67bc to
08472af
Compare
08472af to
5235b00
Compare
|
thanks for testing! could you debug the event in the event loop and copy the log of events for the first few seconds when running the example on windows? bevy/crates/bevy_winit/src/lib.rs Line 365 in e6a324a |
|
events: |
| /// Is `true` if a new [`WindowEvent`] has been received since the last update. | ||
| window_event_received: bool, | ||
| /// Is `true` if a new [`DeviceEvent`] has been received since the last update. | ||
| device_event_received: bool, |
|
I did some fixes for Windows:
|
|
For the button example, it should be a partial fix, for the first steps with the transparent window. the fact that it's not updated is "work as intended", or the bug is in rendering ordering, not in windows management: ui nodes are queued before they are extracted, so the state being drawn is the one from the previous update. I did not have that issue because I'm on a macOS laptop and using the touchpad, which sends events for touch pad pressure and I'm not maintaining the exact same constant pressure so new events are send continuously while clicking |
crates/bevy_winit/src/lib.rs
Outdated
| } | ||
| }; | ||
|
|
||
| if runner_state.start_forced_updates > 0 { |
There was a problem hiding this comment.
Commenting here about why this is required will help avoid breaking this again.
crates/bevy_winit/src/lib.rs
Outdated
| wait_elapsed: false, | ||
| last_update: Instant::now(), | ||
| scheduled_update: None, | ||
| start_forced_updates: 5, |
There was a problem hiding this comment.
A comment here about how this number was chosen would help a lot.
There was a problem hiding this comment.
very scientifically!
on the windows machine I tested I was getting 1 event at start, on my mac it's 3, so 5 has a safe margin of error
I'm not sure I follow. In bevy/crates/bevy_ui/src/render/mod.rs Lines 80 to 101 in 69760c7
My best guess would be that the input change has 1 frame of latency. Looking at |
nicopap
left a comment
There was a problem hiding this comment.
This new revision fixes the issue with the window not rendering on Linux/X11 (When I tested it during my last review, it didn't even show up). I think it's good to go once alice's comments are addressed.
|
@nicopap could you try running the button example on this branch? https://github.com/mockersf/bevy/tree/button-ui-system-order It's just adding some prints. I don't have access to a windows anymore so I'm going from memory of what I saw earlier, but the green background was extracted and not queued on the first click, and the extract system was running after the queue system |
alice-i-cecile
left a comment
There was a problem hiding this comment.
Button example works on Windows for me!

Objective
Solution
Reactiveupdate mode