mojira.dev
MC-263682

Cursor doesn't re-center when opening inventories on Linux

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:

  1. Open inventory and place mouse somewhere on screen

  2. Close inventory and reopen it

  3. Mouse is still there and not in the middle

Attachment

Linked issues

Comments 6

Are there any plans to fix this? It's really annoying!

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

SevenHepteracted's solution does not work for me

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.

dionisis

(Unassigned)

Community Consensus

Platform

Normal

UI

1.20.1, 1.21

Retrieved