mojira.dev
MC-263833

Minecraft is incorrectly assuming it is able to set the window icon on Wayland

All the information can basically be found here, someone already created an issue but probably in the wrong place: https://github.com/glfw/glfw/issues/2347

Linked issues

Comments 3

This is caused by Wayland not using window icons the same way most protocols do and the game trying to set it anyway. There's nothing there to stop the game from calling GLFW#glfwSetWindowIcon while Wayland is in use which just causes the game to crash almost as soon as it starts.

For the developers or general staff members reading this, it should be quite simple to fix this issue in the main game. There is already a very small fabric mod to resolve this problem, it can be found here: https://github.com/Elephant1214/WaylandIconFix

You can most likely copy most of the code over with only minor adjustments.

Other than this, there is only one other error shown in the console while running the game:

[01:39:57] [Render thread/ERROR]: ########## GL ERROR ##########

[01:39:57] [Render thread/ERROR]: @ Render

[01:39:57] [Render thread/ERROR]: 65548: Wayland: The platform does not support setting the cursor position

Although this does not crash the game and also seems to cause no other significant issues, that should definitely be addressed as well.

With the above described fixes, the game should start and run fluently without any problems on Wayland.

 

Hello! Since LWJGL 3.3.4 you can set the GLFW_WAYLAND_APP_ID. (https://javadoc.lwjgl.org/org/lwjgl/glfw/GLFW.html#GLFW_WAYLAND_APP_ID) It's a name of desktop file in Linux. Wayland compositor will use it for showing icon. I have bad knowledge in creating fabric mods, but you should simply add this code after GLFW.glfwInit():

 

if (GLFW.glfwGetPlatform() == GLFW.GLFW_PLATFORM_WAYLAND) {
  GLFW.glfwWindowHintString(GLFW.GLFW_WAYLAND_APP_ID, "minecraft");
}

shaniag

gegy

Plausible

Platform

Important

Crash, UI

1.20.1

23w31a

Retrieved