Move bevy_ui accessibility systems to PostUpdate. (#8653)

# Objective

`bevy_ui` accessibility updates are probably more correctly done in
`PostUpdate`.

## Solution

Move `bevy_ui` accessibility updates to `PostUpdate`.

---------

Co-authored-by: ickshonpe <david.curthoys@googlemail.com>
This commit is contained in:
Nolan Darilek 2023-05-23 18:50:48 -05:00 committed by GitHub
parent df3e81c1fb
commit 897daa0ad6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 5 deletions

View File

@ -6,10 +6,11 @@ use bevy_a11y::{
accesskit::{NodeBuilder, Rect, Role},
AccessibilityNode,
};
use bevy_app::{App, Plugin, Update};
use bevy_app::{App, Plugin, PostUpdate};
use bevy_ecs::{
prelude::{DetectChanges, Entity},
query::{Changed, Without},
schedule::IntoSystemConfigs,
system::{Commands, Query},
world::Ref,
};
@ -147,8 +148,13 @@ pub(crate) struct AccessibilityPlugin;
impl Plugin for AccessibilityPlugin {
fn build(&self, app: &mut App) {
app.add_systems(
Update,
(calc_bounds, button_changed, image_changed, label_changed),
PostUpdate,
(
calc_bounds.after(bevy_transform::TransformSystem::TransformPropagate),
button_changed,
image_changed,
label_changed,
),
);
}
}

View File

@ -10,7 +10,7 @@ use bevy_a11y::{
accesskit::{ActionHandler, ActionRequest, NodeBuilder, NodeClassSet, Role, TreeUpdate},
AccessKitEntityExt, AccessibilityNode, AccessibilityRequested, Focus,
};
use bevy_app::{App, Plugin, Update};
use bevy_app::{App, Plugin, PostUpdate};
use bevy_derive::{Deref, DerefMut};
use bevy_ecs::{
prelude::{DetectChanges, Entity, EventReader, EventWriter},
@ -166,7 +166,7 @@ impl Plugin for AccessibilityPlugin {
.init_resource::<WinitActionHandlers>()
.add_event::<ActionRequest>()
.add_systems(
Update,
PostUpdate,
(
handle_window_focus,
window_closed,