On Linux (wayland), when opening any inventory, the cursor remains in the last position left, rather than be re-centered.
What I expected to happen was...:
Open inventory > mouse is in the center of the window
What actually happened was...:
Open inventory > mouse is in last position when inventory was last opened
Steps to Reproduce:
Open inventory and place mouse somewhere on screen
Close inventory and reopen it
Mouse is still there and not in the middle
Environment
Arch Linux, KDE Wayland, Kernel 6.3.7 - OpenJDK 17
Linked issues
is duplicated by 2
relates to 2
Comments 8
Can confirm this happening on my Arch Linux GNOME 47 Wayland session. No cursor issue on X11/Xorg.
EDIT (Nov/2): It seems the issue is more related to Gnome and KDE with Wayland rather than Minecraft. I tried playing on Hyprland (Wayland compositor), and there was no cursor issue.
same issue on Ubuntu 24.10 with default everything. Would be nice if it was fixed as it's really annoying!
I found a workaround for people who encounter this issue:
Open the Minecraft settings and go to: Options --> Controls --> Mouse Settings
and set Raw Input to "Off"
With this setting changed, my mouse always re-centers to the screen as it should. This isn't optimal since it could cause additional delay, but for me it was an improvement over the mouse position always changing.
Further information: KDE 6.2.4-1, Wayland, Nvidia 565.57
This is probably related to an issue with XWayland on GNOME/KDE as people have reported it works fine on X11.
A workaround for this is to force the game to use a version of glfw with native wayland support. Using MultiMC/Prism Launcher, you can enable the option 'Use system installation of GLFW' under Settings > Minecraft > Tweaks. You'll of course need to install glfw with your system package manager first.
Workaround works for me on Fedora 41 (GNOME 47) with glfw-1:3.3.10-1.fc41.x86_64.
On Arch Linux (GNOME 50) with glfw-1:3.4-1 and Minecraft 1.21.4, forcing system glfw did correct the size of the mouse cursor, which was previously tiny, but it did not cause the mouse cursor to re-center properly. Toggling raw input for the mouse in Minecraft settings also had no effect. NB, Minecraft crashed at startup with an EGL error when using system glfw, unless applying the environment variable __GL_THREADED_OPTIMIZATIONS=0. With Minecraft 26.1, it crashed at startup no matter what with “java.lang.NullPointerException: Initializing game”.
Are there any plans to fix this? It's really annoying!