Mouse cursor is invisible using Wayland on Linux

Godot Version

4.3

Question

The Linux/X11 build of my game works flawlessly, but when launched using the --display-driver wayland flag, the mouse cursor becomes invisible. Everything else about the game works as expected, including the mouse input. I can move the mouse and click buttons, but I have to rely on feel as I can’t see the mouse.

Are there any obvious things to check/try?

I would post this on the Godot GitHub issues, as its clearly a bug.

You could check the Input.mouse_mode. And maybe turn it off and on again. No im not joking. Wayland seems to have some problems with mouse cursor.

Attached is the script for a custom mouse cursor that solved some cursor issues with wayland.

         Input.mouse_mode = Input.MOUSE_MODE_HIDDEN
	
	var crosshair = load("res://entities/Aim/crosshair.png")
	# NOTICE: Changes the cursor only for the shape CURSOR_ARROW
	Input.set_custom_mouse_cursor(crosshair, Input.CURSOR_ARROW, Vector2(52.0, 52.0))
	
	get_viewport().warp_mouse(get_viewport_rect().get_center())
	
	Input.set_mouse_mode(Input.MOUSE_MODE_CONFINED)
	Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)