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.
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.