bevy_persistent_windows/
plugins.rs1use crate::prelude::*;
4
5pub struct PersistentWindowsPlugin;
16
17impl Plugin for PersistentWindowsPlugin {
18 fn build(&self, app: &mut App) {
19 let mut persistent_windows =
20 app.world_mut().query::<(&mut Window, &Persistent<WindowState>)>();
21
22 for (mut window, state) in persistent_windows.iter_mut(app.world_mut()) {
23 utils::apply_state_to_window(&mut window, state);
24 }
25
26 app.add_systems(Startup, auto_scale);
27 app.add_systems(
28 PreUpdate,
29 (
30 on_persistent_window_moved,
31 on_persistent_window_resized,
32 on_persistent_window_scale_factor_changed,
33 ),
34 );
35 app.add_systems(PostUpdate, on_persistent_window_state_changed);
36 }
37}