You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the Wayland DisplayServer you can only update the custom mouse cursor once if you are using Image instead of Texture2D resources and the images have the same hotspot.
The function Input.set_custom_mouse_cursor claims that it is okay to use either an Image or a Texture2D as a custom cursor image. The caching code in DisplayServerWayland::cursor_set_custom_image checks for cursor reuse using "get_rid()" on the provided resource. Since an Image does not have a RID, any image will always enter the branch // We have a cached cursor. Nice..
Bug is visible since #96647 was fixed, although the underlying bug was already older than that.
Workarounds
Use Texture2D instead of image resources - may cause undesired overhead to convert back to image
Reset the cursor in between - may cause cursor flickering
Move the hotspot locations to force a cache miss - unwanted extra work to make images suitable with different hotspots
Steps to reproduce
Force editor and game to use the Wayland display server
Make sure the referenced img1 and img2 are imported as Image and not as Texture.
Input.set_custom_mouse_cursor(img1, Input.CURSOR_ARROW)
# Correctly shows img1 as the cursorInput.set_custom_mouse_cursor(img2, Input.CURSOR_ARROW)
# Still shows img1 as the cursor
Tested versions
System information
Linux Gentoo using Wayland
Issue description
When using the Wayland DisplayServer you can only update the custom mouse cursor once if you are using Image instead of Texture2D resources and the images have the same hotspot.
The function
Input.set_custom_mouse_cursor
claims that it is okay to use either an Image or a Texture2D as a custom cursor image. The caching code inDisplayServerWayland::cursor_set_custom_image
checks for cursor reuse using "get_rid()" on the provided resource. Since an Image does not have a RID, any image will always enter the branch// We have a cached cursor. Nice.
.Bug is visible since #96647 was fixed, although the underlying bug was already older than that.
Workarounds
Steps to reproduce
img1
andimg2
are imported as Image and not as Texture.Minimal reproduction project (MRP)
wayland-cursor-reproducer.zip
The text was updated successfully, but these errors were encountered: