This commit is contained in:
Jan Hohenheim 2025-07-17 23:06:43 +02:00 committed by GitHub
commit 5d0a4dd404
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,6 +19,7 @@ extern crate alloc;
use alloc::sync::Arc; use alloc::sync::Arc;
use bevy_ecs::system::Commands;
use bevy_platform::sync::Mutex; use bevy_platform::sync::Mutex;
mod event; mod event;
@ -130,14 +131,16 @@ impl Plugin for WindowPlugin {
.add_event::<AppLifecycle>(); .add_event::<AppLifecycle>();
if let Some(primary_window) = &self.primary_window { if let Some(primary_window) = &self.primary_window {
let mut entity_commands = app.world_mut().spawn(primary_window.clone()); let primary_window = primary_window.clone();
entity_commands.insert(( let primary_cursor_options = self.primary_cursor_options.clone().unwrap_or_default();
PrimaryWindow, app.add_systems(PreStartup, move |mut commands: Commands| {
RawHandleWrapperHolder(Arc::new(Mutex::new(None))), commands.spawn((
)); primary_window.clone(),
if let Some(primary_cursor_options) = &self.primary_cursor_options { PrimaryWindow,
entity_commands.insert(primary_cursor_options.clone()); RawHandleWrapperHolder(Arc::new(Mutex::new(None))),
} primary_cursor_options.clone(),
));
});
} }
match self.exit_condition { match self.exit_condition {