-
Bug
-
Resolution: Unresolved
-
None
-
1.20, 1.20.1 Release Candidate 1, 1.20.1, 1.20.6, 24w21b
-
None
-
Community Consensus
-
UI
-
Low
-
Platform
steps to reproduce:
- make game window unmaximized
- load up world
- when in world before pausing or opening any other screens, maximize game window
- open inventory
or
- load up world
- turn pause on lost focus off
- alt-tab to another window
- move cursor position
- alt-tab back in
- open inventory
you will see that the cursor is somewhere up and to the left of the center of the screen.
code analysis (credit: jojoe77777):
this is caused by InputMappings$grabOrReleaseMouse calling GLFW$glfwSetInputMode before calling GLFW$glfwSetCursorPos. If these calls are reversed and glfwSetCursorPos is called first, the cursor is placed as expected in both cases to reproduce as outlined above.
This bug was introduced sometime between 1.13.2 and 1.14.0 per my testing, which makes a lot of sense.
- relates to
-
MC-150164 Cursor position does not reset after alt-tabbing into the game with pause on focus loss disabled
- Open