Skip to content

Commit 3b3ac9a

Browse files
committed
fix: hide cursor on linux when mouse locked
1 parent ac36bfa commit 3b3ac9a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/common/input/mouse.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ namespace our {
9999
// Locks the mouse position and hides it (Usually used for FPS games)
100100
static void lockMouse(GLFWwindow* window) {
101101
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED);
102+
glfwSetCursor(
103+
window,
104+
nullptr); // This is needed to prevent a GLFW bug where the cursor is visible again after locking it.
102105
}
103106
// If the mouse was locked, unlock it (make it visible and allow it to move)
104107
static void unlockMouse(GLFWwindow* window) {

0 commit comments

Comments
 (0)