Cursor Position is not set correctly in the center of the window after resize
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.
2023-06-09, 09:27 PM
2024-12-14, 07:11 PM
0
1
-