-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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 Reactive and ReactiveLowPower update modes #11325
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:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm on Linux/X11.
Testing with the button
example:
cargo run --example button
Still shows the bugs described in #11235.
Thank you for cleaning after us, but this isn't ready yet.
@@ -254,6 +254,8 @@ struct WinitAppRunnerState { | |||
active: ActiveState, | |||
/// 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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commenting here about why this is required will help avoid breaking this again.
crates/bevy_winit/src/lib.rs
Outdated
redraw_requested: false, | ||
wait_elapsed: false, | ||
last_update: Instant::now(), | ||
scheduled_update: None, | ||
start_forced_updates: 5, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A comment here about how this number was chosen would help a lot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Button example works on Windows for me!
Objective
Solution
Reactive
update mode