migrate: 0.16.1 to 0.18.1 (thanks claude!)

This commit is contained in:
2026-05-25 12:17:42 +01:00
parent 97dfe31197
commit 64e1e5481e
12 changed files with 1126 additions and 719 deletions
+12 -3
View File
@@ -13,7 +13,7 @@ use smithay_client_toolkit::{
compositor::{CompositorHandler, CompositorState},
delegate_compositor,
reexports::client::{
backend::ObjectId, protocol::wl_surface::WlSurface, Connection, Proxy, QueueHandle,
Connection, Proxy, QueueHandle, backend::ObjectId, protocol::wl_surface::WlSurface,
},
};
@@ -21,6 +21,12 @@ use crate::WaylandState;
#[derive(Component)]
pub struct SurfaceConfigured;
#[derive(SystemSet, Debug, Clone, PartialEq, Eq, Hash)]
pub enum SurfaceHandlerSystems {
CreateWindows,
}
pub struct SurfaceHandlerPlugin;
impl Plugin for SurfaceHandlerPlugin {
fn build(&self, app: &mut App) {
@@ -30,7 +36,10 @@ impl Plugin for SurfaceHandlerPlugin {
CompositorState::bind(globals, queue_handle).expect("failed to bind compositor!"),
);
app.insert_non_send_resource(WaylandSurfaces::default());
app.add_systems(PreUpdate, create_windows);
app.add_systems(
PreUpdate,
create_windows.in_set(SurfaceHandlerSystems::CreateWindows),
);
}
}
@@ -173,7 +182,7 @@ pub fn create_windows(
connection: NonSend<Connection>,
queue_handle: NonSend<QueueHandle<WaylandState>>,
bevy_windows: Query<(Entity, Option<&RawHandleWrapperHolder>), With<Window>>,
mut window_created_event: EventWriter<WindowCreated>,
mut window_created_event: MessageWriter<WindowCreated>,
) {
for (entity, handle_holder) in &bevy_windows {
if wayland_surfaces.get_window_wrapper(entity).is_some() {