Skip to content

Conversation

@Kyran-art
Copy link
Contributor

@Kyran-art Kyran-art commented Nov 21, 2025

toggle mouse passthrough on Bevy 0.14+ (use CursorOptions component instead of window.cursor)

The second commit was me cleaning up some personal residue. Should be clean now.

The cursor hit-test setting was moved from Window.cursor.hit_test to a separate
CursorOptions component in Bevy 0.14. Update the toggle_window_passthrough system
to query and modify CursorOptions instead.

Closes the compile error on Bevy 0.17 🎉
The cursor hit-test setting was moved from Window.cursor.hit_test to a separate
CursorOptions component in Bevy 0.14. Update the toggle_window_passthrough system
to query and modify CursorOptions instead.

Closes the compile error on Bevy 0.17 🎉
Copy link
Owner

@alphastrata alphastrata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool cool.

Thanks for the PR can you split it up into two please? one for the pass-through and one for the drag-n-drop png support.
(Just makes it easier from a maintainer POV to see what went in where..)


fn main() {
let args: Vec<String> = env::args().collect();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

which version of rustfmt are you using?

pub fn toggle_window_passthrough(
keyboard_input: Res<ButtonInput<KeyCode>>,
mut windows: Query<&mut Window>,
mut windows: Query<(&mut Window, &mut CursorOptions)>, // Query both!
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary comment

@alphastrata
Copy link
Owner

p.s @Kyran-art great catch on the png support -- I'd dropped the ball there for drag-n-drop... my bad.

@Kyran-art Kyran-art closed this by deleting the head repository Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants