@@ -85,13 +85,11 @@ impl Plugin for WinitPlugin {
8585 app. init_non_send_resource :: < WinitWindows > ( )
8686 . init_resource :: < WinitSettings > ( )
8787 . set_runner ( winit_runner)
88- // exit_on_all_closed only uses the query to determine if the query is empty,
89- // and so doesn't care about ordering relative to changed_window
9088 . add_systems (
9189 Last ,
9290 (
93- // `exit_on_all_closed` seemingly conflicts with `changed_window`
94- // but does not actually access any data (only checks if the query is empty)
91+ // `exit_on_all_closed` only checks if windows exist but doesn't access data,
92+ // so we don't need to care about its ordering relative to `changed_windows`
9593 changed_windows. ambiguous_with ( exit_on_all_closed) ,
9694 // apply all changes first, then despawn windows
9795 despawn_windows. after ( changed_windows) ,
@@ -105,16 +103,16 @@ impl Plugin for WinitPlugin {
105103
106104 let event_loop = event_loop_builder. build ( ) ;
107105
108- // iOS, macOS, and Android don't like it if you create windows before the
109- // event loop is initialized.
106+ // iOS, macOS, and Android don't like it if you create windows before the event loop is
107+ // initialized.
110108 //
111109 // See:
112110 // - https://github.com/rust-windowing/winit/blob/master/README.md#macos
113111 // - https://github.com/rust-windowing/winit/blob/master/README.md#ios
114112 #[ cfg( not( any( target_os = "android" , target_os = "ios" , target_os = "macos" ) ) ) ]
115113 {
116- // Otherwise, we want to create a window before `bevy_render` initializes
117- // the renderer so that we have a surface to use as a hint.
114+ // Otherwise, we want to create a window before `bevy_render` initializes the renderer
115+ // so that we have a surface to use as a hint.
118116 // This improves compatibility with wgpu backends, especially WASM/WebGL2.
119117 let mut create_windows = IntoSystem :: into_system ( create_windows :: < ( ) > ) ;
120118 create_windows. initialize ( & mut app. world ) ;
@@ -242,7 +240,8 @@ unsafe fn transmute_to_static_ref<T>(r: &T) -> &'static T {
242240
243241/// The default [`App::runner`] for the [`WinitPlugin`] plugin.
244242///
245- /// Overriding the app's [runner](bevy_app::App::runner) while using `WinitPlugin` will bypass the `EventLoop`.
243+ /// Overriding the app's [runner](bevy_app::App::runner) while using `WinitPlugin` will bypass the
244+ /// `EventLoop`.
246245pub fn winit_runner ( mut app : App ) {
247246 let mut event_loop = app
248247 . world
@@ -450,9 +449,9 @@ pub fn winit_runner(mut app: App) {
450449 let new_factor = window. resolution . scale_factor ( ) ;
451450
452451 if let Some ( forced_factor) = window. resolution . scale_factor_override ( ) {
453- // This window is overriding the OS-suggested DPI, so its physical
454- // size should be set based on the overriding value.
455- // Its logical size already incorporates any resize constraints.
452+ // This window is overriding the OS-suggested DPI, so its physical size
453+ // should be set based on the overriding value. Its logical size already
454+ // incorporates any resize constraints.
456455 * new_inner_size =
457456 winit:: dpi:: LogicalSize :: new ( window. width ( ) , window. height ( ) )
458457 . to_physical :: < u32 > ( forced_factor) ;
0 commit comments