From 38b2f09365daa7ed8cf6480fd0c28db44303ba19 Mon Sep 17 00:00:00 2001 From: elm <71685838+not-elm@users.noreply.github.com> Date: Tue, 19 Aug 2025 20:20:22 +0900 Subject: [PATCH] fix: avoid crash on update_cursor_icon (#7) --- CHANGELOG.md | 3 ++- src/cursor_icon.rs | 12 +++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4aaf191..c7710c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,8 @@ ### Bug Fixes -- Fixed so that webview can detect pointers correctly even if it is not the root entity. +- Fixed so that the webview can detect pointers correctly even if it is not the root entity. +- Avoid a crash when updating the cursor icon ### Breaking Changes diff --git a/src/cursor_icon.rs b/src/cursor_icon.rs index 78d5799..db3b905 100644 --- a/src/cursor_icon.rs +++ b/src/cursor_icon.rs @@ -22,17 +22,15 @@ pub(crate) struct SystemCursorIconSender(Sender); pub(crate) struct SystemCursorIconReceiver(pub(crate) Receiver); fn update_cursor_icon( - par_commands: ParallelCommands, + mut commands: Commands, cursor_icon_receiver: Res, windows: Query, ) { while let Ok(cursor_icon) = cursor_icon_receiver.0.try_recv() { - windows.par_iter().for_each(|window| { - par_commands.command_scope(|mut commands| { - commands - .entity(window) - .insert(CursorIcon::System(cursor_icon)); - }); + windows.iter().for_each(|window| { + commands + .entity(window) + .insert(CursorIcon::System(cursor_icon)); }); } }