Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-263368

Cursor Position is not set correctly in the center of the window after resize

XMLWordPrintable

    • Icon: Bug 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.

            Unassigned Unassigned
            tildejustin tildejustin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              CHK: