When I create my initial window, if I want to hide the system cursor I call the following:
glfwSetInputMode(this->glfwWindow, GLFW_CURSOR, GLFW_CURSOR_DISABLED); glfwSetInputMode(this->glfwWindow, GLFW_RAW_MOUSE_MOTION, GLFW_TRUE);
If I want the cursor to display, I simply do not call the above code. This works fine. However when I attempt to do this at runtime, for example, start a window and display a cursor (not calling the above code on window creation), and then call the above code at a later time (for example a main menu system for a game displays cursor so user can select which map to load, then once selection is made cursor should no longer be visible), the cursor disappears as expected when over the window region, but does not lock to the window (if cursor moved past window region it displays) and glfwGetCursorPos() does not update the cursor position.
If I click on something outside of the window (say a black space on my desktop) and then click back into the window, the mouse cursor is hidden, locked, updating position, and working as expected.
I feel like I may be doing something incorrectly in regards to swapping between displaying and not displaying the cursor…possibly?
As always, any assistance is greatly appreciated! Thanks