Skip to content

Commit d2416a4

Browse files
committed
Adjust schedules to add systems
1 parent fe794a8 commit d2416a4

File tree

4 files changed

+12
-16
lines changed

4 files changed

+12
-16
lines changed

crates/bevy_window/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,17 +95,17 @@ impl Plugin for WindowPlugin {
9595

9696
match self.exit_condition {
9797
ExitCondition::OnPrimaryClosed => {
98-
app.add_systems(PostUpdate, exit_on_primary_closed);
98+
app.add_systems(Control, exit_on_primary_closed);
9999
}
100100
ExitCondition::OnAllClosed => {
101-
app.add_systems(PostUpdate, exit_on_all_closed);
101+
app.add_systems(Control, exit_on_all_closed);
102102
}
103103
ExitCondition::DontExit => {}
104104
}
105105

106106
if self.close_when_requested {
107107
// Need to run before `exit_on_*` systems
108-
app.add_systems(PostUpdate, close_when_requested);
108+
app.add_systems(Control, close_when_requested);
109109
}
110110

111111
// Register event types

crates/bevy_winit/src/accessibility.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use bevy_a11y::{
1111
accesskit::{ActionHandler, ActionRequest, NodeBuilder, NodeClassSet, Role, TreeUpdate},
1212
AccessKitEntityExt, AccessibilityNode, AccessibilityRequested, Focus,
1313
};
14-
use bevy_app::{App, Plugin, PostUpdate};
14+
use bevy_app::{App, Control, FrameReady, Plugin};
1515
use bevy_derive::{Deref, DerefMut};
1616
use bevy_ecs::{
1717
prelude::{DetectChanges, Entity, EventReader, EventWriter},
@@ -170,13 +170,9 @@ impl Plugin for AccessibilityPlugin {
170170
.init_resource::<WinitActionHandlers>()
171171
.add_event::<ActionRequestWrapper>()
172172
.add_systems(
173-
PostUpdate,
174-
(
175-
handle_window_focus,
176-
window_closed,
177-
poll_receivers,
178-
update_accessibility_nodes,
179-
),
180-
);
173+
Control,
174+
(handle_window_focus, window_closed, poll_receivers),
175+
)
176+
.add_systems(FrameReady, update_accessibility_nodes);
181177
}
182178
}

crates/bevy_winit/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub use winit_config::*;
2929
pub use winit_handler::*;
3030
pub use winit_windows::*;
3131

32-
use bevy_app::{App, AppExit, Last, Plugin};
32+
use bevy_app::{App, AppExit, Plugin, Control};
3333
use bevy_ecs::event::ManualEventReader;
3434
use bevy_ecs::prelude::*;
3535
use bevy_input::{
@@ -108,7 +108,7 @@ impl Plugin for WinitPlugin {
108108
// exit_on_all_closed only uses the query to determine if the query is empty,
109109
// and so doesn't care about ordering relative to changed_window
110110
.add_systems(
111-
Last,
111+
Control,
112112
(
113113
changed_window.ambiguous_with(exit_on_all_closed),
114114
// Update the state of the window before attempting to despawn to ensure consistent event ordering

crates/bevy_winit/src/web_resize.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::WinitWindows;
2-
use bevy_app::{App, Plugin, Update};
2+
use bevy_app::{App, Plugin};
33
use bevy_ecs::prelude::*;
44
use crossbeam_channel::{Receiver, Sender};
55
use wasm_bindgen::JsCast;
@@ -10,7 +10,7 @@ pub(crate) struct CanvasParentResizePlugin;
1010
impl Plugin for CanvasParentResizePlugin {
1111
fn build(&self, app: &mut App) {
1212
app.init_resource::<CanvasParentResizeEventChannel>()
13-
.add_systems(Update, canvas_parent_resize_event_handler);
13+
.add_systems(Control, canvas_parent_resize_event_handler);
1414
}
1515
}
1616

0 commit comments

Comments
 (0)