Skip to content

Commit c808756

Browse files
committed
Wayland: Check custom cursor resource reference for cache invalidation
Images don't have RIDs and this way of checking stuff broke the cursor cache. Let's do like all other platforms and check the resource reference instead.
1 parent b0655dc commit c808756

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

platform/linuxbsd/wayland/display_server_wayland.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,7 +1033,7 @@ void DisplayServerWayland::cursor_set_custom_image(const Ref<Resource> &p_cursor
10331033
HashMap<CursorShape, CustomCursor>::Iterator cursor_c = custom_cursors.find(p_shape);
10341034

10351035
if (cursor_c) {
1036-
if (cursor_c->value.rid == p_cursor->get_rid() && cursor_c->value.hotspot == p_hotspot) {
1036+
if (cursor_c->value.resource == p_cursor && cursor_c->value.hotspot == p_hotspot) {
10371037
// We have a cached cursor. Nice.
10381038
wayland_thread.cursor_set_shape(p_shape);
10391039
return;
@@ -1049,7 +1049,7 @@ void DisplayServerWayland::cursor_set_custom_image(const Ref<Resource> &p_cursor
10491049

10501050
CustomCursor &cursor = custom_cursors[p_shape];
10511051

1052-
cursor.rid = p_cursor->get_rid();
1052+
cursor.resource = p_cursor;
10531053
cursor.hotspot = p_hotspot;
10541054

10551055
wayland_thread.cursor_shape_set_custom_image(p_shape, image, p_hotspot);

platform/linuxbsd/wayland/display_server_wayland.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class DisplayServerWayland : public DisplayServer {
101101
};
102102

103103
struct CustomCursor {
104-
RID rid;
104+
Ref<Resource> resource;
105105
Point2i hotspot;
106106
};
107107

0 commit comments

Comments
 (0)