Skip to content

Commit 7b40cec

Browse files
committed
comments
1 parent 76ff059 commit 7b40cec

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/bevy_winit/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,8 @@ pub fn winit_runner(mut app: App) {
396396
window.resolution.physical_height() as f64 - position.y,
397397
);
398398

399+
// bypassing change detection to not trigger feedback loop with system `changed_window`
400+
// this system change the cursor position in winit
399401
window
400402
.bypass_change_detection()
401403
.set_physical_cursor_position(Some(physical_position));
@@ -414,6 +416,8 @@ pub fn winit_runner(mut app: App) {
414416
WindowEvent::CursorLeft { .. } => {
415417
// Component
416418
if let Ok((mut window, _)) = window_query.get_mut(window_entity) {
419+
// bypassing change detection to not trigger feedback loop with system `changed_window`
420+
// this system change the cursor position in winit
417421
window
418422
.bypass_change_detection()
419423
.set_physical_cursor_position(None);

0 commit comments

Comments
 (0)