In the GLFW 3.3.2 port, hiding cursor with
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_HIDDEN) or
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED) does not
work properly. This leads the cursor being visible in post-1.12
Minecraft versions.

This bug can be reproduced with the following code:

#include <stdio.h>
#include <GLFW/glfw3.h>

int main() {
  glfwInit();
  fprintf(stdout, "create window\n");
  GLFWwindow *win = glfwCreateWindow(640, 480, "title", NULL, NULL);
  fprintf(stdout, "set cursor HIDDEN\n");
  // GLFW_CURSOR_DISABLED can be replaced with GLFW_CURSOR_HIDDEN
  glfwSetInputMode(win, GLFW_CURSOR, GLFW_CURSOR_DISABLED);
  while (!glfwWindowShouldClose(win)) {
    glfwPollEvents();
    glfwSwapBuffers(win);
  }
  fprintf(stdout, "close window\n");
  glfwTerminate();
}


The expected result should for GLFW_CURSOR_HIDDEN should be the cursor
disappearing when it is on the window, whereas for GLFW_CURSOR_DISABLED
the cursor should be invisible, captured in the middle of the window.
However, what happens is that for GLFW_CURSOR_HIDDEN, there is no
effects at all, whereas for GLFW_CURSOR_DISABLED, the cursor is captured
in the middle as expected, but the cursor is still visible.

Reply via email to