Skip to content

Commit

Permalink
Merge pull request bevyengine#6 from mockersf/winit-0.30-fix-patches
Browse files Browse the repository at this point in the history
fix patches
  • Loading branch information
pietrosophya authored May 19, 2024
2 parents f2f3d93 + 00fa59b commit 1115013
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 23 deletions.
30 changes: 15 additions & 15 deletions tools/example-showcase/extra-window-resized-events.patch
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
diff --git a/crates/bevy_winit/src/lib.rs b/crates/bevy_winit/src/lib.rs
index 63d79b1d2..83ed56293 100644
--- a/crates/bevy_winit/src/lib.rs
+++ b/crates/bevy_winit/src/lib.rs
@@ -429,6 +429,12 @@ fn handle_winit_event(
diff --git a/crates/bevy_winit/src/state.rs b/crates/bevy_winit/src/state.rs
index c256f5492..ae065111b 100644
--- a/crates/bevy_winit/src/state.rs
+++ b/crates/bevy_winit/src/state.rs
@@ -198,6 +198,12 @@ impl<T: Event> ApplicationHandler<T> for WinitAppRunnerState<T> {
}
}

runner_state.window_event_received = true;

+ window_resized.send(WindowResized {
+ window,
+ width: win.width(),
+ height: win.height(),
+ });
+ window_resized.send(WindowResized {
+ window,
+ width: win.width(),
+ height: win.height(),
+ });
+
match event {
WindowEvent::Resized(size) => {
react_to_resize(&mut win, size, &mut window_resized, window);
match event {
WindowEvent::Resized(size) => {
react_to_resize(&mut win, size, &mut window_resized, window);
12 changes: 4 additions & 8 deletions tools/example-showcase/remove-desktop-app-mode.patch
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
diff --git a/crates/bevy_winit/src/winit_config.rs b/crates/bevy_winit/src/winit_config.rs
index f2cb424ec..e68e01de0 100644
index 104384086..6e3c8dd83 100644
--- a/crates/bevy_winit/src/winit_config.rs
+++ b/crates/bevy_winit/src/winit_config.rs
@@ -31,14 +31,7 @@ impl WinitSettings {
@@ -29,10 +29,7 @@ impl WinitSettings {
///
/// Use the [`EventLoopProxy`](crate::EventLoopProxy) to request a redraw from outside bevy.
pub fn desktop_app() -> Self {
- WinitSettings {
- focused_mode: UpdateMode::Reactive {
- wait: Duration::from_secs(5),
- },
- unfocused_mode: UpdateMode::ReactiveLowPower {
- wait: Duration::from_secs(60),
- },
- focused_mode: UpdateMode::reactive(Duration::from_secs(5)),
- unfocused_mode: UpdateMode::reactive_low_power(Duration::from_secs(60)),
- }
+ Self::default()
}
Expand Down

0 comments on commit 1115013

Please sign in to comment.