Skip to content

Commit

Permalink
Adjust schedules to add systems
Browse files Browse the repository at this point in the history
  • Loading branch information
B-head committed Jul 7, 2023
1 parent fe794a8 commit d2416a4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 16 deletions.
6 changes: 3 additions & 3 deletions crates/bevy_window/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,17 @@ impl Plugin for WindowPlugin {

match self.exit_condition {
ExitCondition::OnPrimaryClosed => {
app.add_systems(PostUpdate, exit_on_primary_closed);
app.add_systems(Control, exit_on_primary_closed);
}
ExitCondition::OnAllClosed => {
app.add_systems(PostUpdate, exit_on_all_closed);
app.add_systems(Control, exit_on_all_closed);
}
ExitCondition::DontExit => {}
}

if self.close_when_requested {
// Need to run before `exit_on_*` systems
app.add_systems(PostUpdate, close_when_requested);
app.add_systems(Control, close_when_requested);
}

// Register event types
Expand Down
14 changes: 5 additions & 9 deletions crates/bevy_winit/src/accessibility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use bevy_a11y::{
accesskit::{ActionHandler, ActionRequest, NodeBuilder, NodeClassSet, Role, TreeUpdate},
AccessKitEntityExt, AccessibilityNode, AccessibilityRequested, Focus,
};
use bevy_app::{App, Plugin, PostUpdate};
use bevy_app::{App, Control, FrameReady, Plugin};
use bevy_derive::{Deref, DerefMut};
use bevy_ecs::{
prelude::{DetectChanges, Entity, EventReader, EventWriter},
Expand Down Expand Up @@ -170,13 +170,9 @@ impl Plugin for AccessibilityPlugin {
.init_resource::<WinitActionHandlers>()
.add_event::<ActionRequestWrapper>()
.add_systems(
PostUpdate,
(
handle_window_focus,
window_closed,
poll_receivers,
update_accessibility_nodes,
),
);
Control,
(handle_window_focus, window_closed, poll_receivers),
)
.add_systems(FrameReady, update_accessibility_nodes);
}
}
4 changes: 2 additions & 2 deletions crates/bevy_winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub use winit_config::*;
pub use winit_handler::*;
pub use winit_windows::*;

use bevy_app::{App, AppExit, Last, Plugin};
use bevy_app::{App, AppExit, Plugin, Control};
use bevy_ecs::event::ManualEventReader;
use bevy_ecs::prelude::*;
use bevy_input::{
Expand Down Expand Up @@ -108,7 +108,7 @@ impl Plugin for WinitPlugin {
// exit_on_all_closed only uses the query to determine if the query is empty,
// and so doesn't care about ordering relative to changed_window
.add_systems(
Last,
Control,
(
changed_window.ambiguous_with(exit_on_all_closed),
// Update the state of the window before attempting to despawn to ensure consistent event ordering
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_winit/src/web_resize.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::WinitWindows;
use bevy_app::{App, Plugin, Update};
use bevy_app::{App, Plugin};
use bevy_ecs::prelude::*;
use crossbeam_channel::{Receiver, Sender};
use wasm_bindgen::JsCast;
Expand All @@ -10,7 +10,7 @@ pub(crate) struct CanvasParentResizePlugin;
impl Plugin for CanvasParentResizePlugin {
fn build(&self, app: &mut App) {
app.init_resource::<CanvasParentResizeEventChannel>()
.add_systems(Update, canvas_parent_resize_event_handler);
.add_systems(Control, canvas_parent_resize_event_handler);
}
}

Expand Down

0 comments on commit d2416a4

Please sign in to comment.