Skip to content

Use None instead of Confined fallback for CursorGrabMode - #25273

Open
piedoom wants to merge 2 commits into
bevyengine:mainfrom
piedoom:grab_fallback
Open

Use None instead of Confined fallback for CursorGrabMode#25273
piedoom wants to merge 2 commits into
bevyengine:mainfrom
piedoom:grab_fallback

Conversation

@piedoom

@piedoom piedoom commented Aug 2, 2026

Copy link
Copy Markdown

Objective

MacOS does not support CursorGrabMode::Confined, and falls back to Locked. This is problematic, as Confined is used for dragging gizmos. The result is that Mac users cannot interact.

This should fix #18732 #24476

Solution

This PR changes the fallback for when Confined does not exist to None, instead of Confined. There does not appear to be a nice fallback that retains the functionality of Confined, but I believe using None is an OK tradeoff, and will re-enable mac functionality.

Testing

Changes were tested by changing the problematic line and testing an example on MacOS, setting the cursor to Confined. Before the change, the cursor is locked. After the change, it is freed.

I also tested the transform gizmo example on Mac which is now working.

Note this may have consequences if users are relying on this fallback behavior for Mac.

I have only tested this on Mac. Viewing the code, it appears that the other exception (X11) would be unaffected. I don't know much about web.

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Welcome, new contributor!

Please make sure you've read our contributing guide, as well as our policy regarding AI usage, and we look forward to reviewing your pull request shortly ✨

@kfc35 kfc35 added C-Bug An unexpected or incorrect behavior D-Straightforward Simple bug fixes and API improvements, docs, test and examples A-Editor Graphical tools to make Bevy games S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Aug 2, 2026
@kfc35
kfc35 requested review from IceSentry and janhohenheim August 2, 2026 22:41
@CorvusPrudens CorvusPrudens 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 Aug 2, 2026
@kfc35 kfc35 added this to the 0.19.1 milestone Aug 2, 2026

@mockersf mockersf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

doc comment describing the fallback should be updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Editor Graphical tools to make Bevy games 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.

Touchpad doesn't work on MacOS with CursorGrabMode::Confined

4 participants