-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Transform Gizmo does not work on MacOS with default TransformGizmoSettings (due to CursorGrabMode Logic) #24476
Copy link
Copy link
Open
Labels
A-EditorGraphical tools to make Bevy gamesGraphical tools to make Bevy gamesA-GizmosVisual editor and debug gizmosVisual editor and debug gizmosC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorC-DocsAn addition or correction to our documentationAn addition or correction to our documentationD-TrivialNice and easy! A great choice to get started with BevyNice and easy! A great choice to get started with BevyO-MacOSSpecific to the MacOS (Apple) desktop operating systemSpecific to the MacOS (Apple) desktop operating systemS-Needs-DesignThis issue requires design work to think about how it would best be accomplishedThis issue requires design work to think about how it would best be accomplished
Metadata
Metadata
Assignees
Labels
A-EditorGraphical tools to make Bevy gamesGraphical tools to make Bevy gamesA-GizmosVisual editor and debug gizmosVisual editor and debug gizmosC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorC-DocsAn addition or correction to our documentationAn addition or correction to our documentationD-TrivialNice and easy! A great choice to get started with BevyNice and easy! A great choice to get started with BevyO-MacOSSpecific to the MacOS (Apple) desktop operating systemSpecific to the MacOS (Apple) desktop operating systemS-Needs-DesignThis issue requires design work to think about how it would best be accomplishedThis issue requires design work to think about how it would best be accomplished
Type
Fields
Give feedbackNo fields configured for issues without a type.
Bevy version and features
On main 5dc6e46
[Optional] Relevant system information
MacOS 26.5
Using a Trackpad
AdapterInfo { name: "Apple M4", vendor: 0, device: 0, device_type: IntegratedGpu, device_pci_bus_id: "", driver: "", driver_info: "", backend: Metal, subgroup_min_size: 4, subgroup_max_size: 64, transient_saves_memory: true }
What you did
I tried to run the basic transform gizmo example without modifications and tried interacting with the transform gizmo
What went wrong
The mouse locks in place and I’m unable to move the cursor in order to scale/translate/rotate.
This is because, when using the Transform Gizmo, the cursor grab mode is set to
Confined, which is unsupported on MacOS:https://github.com/bevyengine/bevy/blob/main/crates/bevy_window/src/window.rs#L763-L772
The documentation further elucidates what happens in this case:
I was able to fix this bug by changing the base logic here of setting the cursor grab to None instead of Locked when Confined is not available:
https://github.com/bevyengine/bevy/blob/main/crates/bevy_winit/src/winit_windows.rs#L426-L428
I can also fix this by changing the “confine_cursor” field to false in
TransformGizmoSettingsbevy/crates/bevy_gizmos/src/transform_gizmo.rs
Lines 155 to 156 in 5dc6e46
Since this caused a 15 minute distraction from trying to debug something with Transform Gizmos, I open this issue to question whether the bevy_winit fallback logic should be changed, or whether confine_cursor should maybe be false as a Default instead.
If no logic should be changed, at the very least, I think TransformGizmo should have documentation saying that
confine_cursorshould be set to false for MacOS due to it being unsupported there.