Skip to content

Conversation

@janis-bhm
Copy link
Contributor

Objective

Fixes #21482

Solution

Before exiting the system when the controller is disabled, check if either of the cursor grab flags are set and ungrab any windows if so.
Note: I think it's a bit strange that the camera un-grabs every window, not just the one with focus, but I've just copied this behaviour from further down in the function. In this case, it might be more correct to do this anyway, since the controller might be disabled when the respective window isn't focused.

Testing

I used #21477 to test this

@janis-bhm janis-bhm added C-Bug An unexpected or incorrect behavior A-Dev-Tools Tools used to debug Bevy applications. S-Needs-Review Needs reviewer attention (from anyone!) to move forward A-Camera User-facing camera APIs and controllers. labels Oct 9, 2025
@alice-i-cecile alice-i-cecile added the D-Straightforward Simple bug fixes and API improvements, docs, test and examples label Oct 9, 2025
@alice-i-cecile alice-i-cecile added this to the 0.18 milestone Oct 9, 2025
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Oct 10, 2025
@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Oct 10, 2025
Merged via the queue into bevyengine:main with commit fef6b51 Oct 10, 2025
49 checks passed
mate-h pushed a commit to mate-h/bevy that referenced this pull request Oct 22, 2025
…is disabled (bevyengine#21485)

# Objective
Fixes bevyengine#21482

## Solution
Before exiting the system when the controller is disabled, check if
either of the cursor grab flags are set and ungrab any windows if so.
Note: I think it's a bit strange that the camera un-grabs every window,
not just the one with focus, but I've just copied this behaviour from
further down in the function. In this case, it might be more correct to
do this anyway, since the controller might be disabled when the
respective window isn't focused.

## Testing

I used bevyengine#21477 to test this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Camera User-facing camera APIs and controllers. A-Dev-Tools Tools used to debug Bevy applications. C-Bug An unexpected or incorrect behavior D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FreeCam: disabling the free cam while the mouse is captured prevents user from freeing mouse again.

3 participants