godotengine / godotengine/godot
macOS: In non floating embedded game, switching from Input.MOUSE_MODE_CAPTURED to Input.MOUSE_MODE_VISIBLE moves the mouse to the wrong location
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
- Reproducible in 4.5 beta 6
### System information
Godot v4.5.beta (5d2be5423) - macOS Sequoia (15.6.1) - Multi-window, 1 monitor - Metal (Forward+) - integrated Apple M4 Max (Apple9) - Apple M4 Max (14 threads) - 36.00 GiB memory
### Issue description
As you can see in the gif below, switching from Input.MOUSE_MODE_CAPTURED to Input.MOUSE_MODE_VISIBLE in non floating embedding moves the mouse to the center of the display instead of the center of the window.

It works as expected when using floating game embedding even when the window is moved, showing the mouse in the center of the window.

### Steps to reproduce
1. Disable "Make Workspace Floating on Next Play"
2. Toggle between Input.MOUSE_MODE_CAPTURED and Input.MOUSE_MODE_VISIBLE
### Minimal reproduction project (MRP)
[mouse-mode-position.zip](https://github.com/user-attachments/files/21948178/mouse-mode-position.zip)
Contributor guide
Assessment
This issue has not been assessed yet.