You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Properly revert cursor when using set_custom_mouse_cursor with null
Fixes #32486
This commit is contained in:
@@ -574,6 +574,8 @@ void OS_JavaScript::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_s
|
|||||||
}, cursors[p_shape].utf8().get_data());
|
}, cursors[p_shape].utf8().get_data());
|
||||||
/* clang-format on */
|
/* clang-format on */
|
||||||
cursors[p_shape] = "";
|
cursors[p_shape] = "";
|
||||||
|
|
||||||
|
cursors_cache.erase(p_shape);
|
||||||
}
|
}
|
||||||
|
|
||||||
set_cursor_shape(cursor_shape);
|
set_cursor_shape(cursor_shape);
|
||||||
|
|||||||
@@ -1973,11 +1973,16 @@ void OS_OSX::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, c
|
|||||||
[nsimage release];
|
[nsimage release];
|
||||||
} else {
|
} else {
|
||||||
// Reset to default system cursor
|
// Reset to default system cursor
|
||||||
|
if (cursors[p_shape] != NULL) {
|
||||||
|
[cursors[p_shape] release];
|
||||||
cursors[p_shape] = NULL;
|
cursors[p_shape] = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
CursorShape c = cursor_shape;
|
CursorShape c = cursor_shape;
|
||||||
cursor_shape = CURSOR_MAX;
|
cursor_shape = CURSOR_MAX;
|
||||||
set_cursor_shape(c);
|
set_cursor_shape(c);
|
||||||
|
|
||||||
|
cursors_cache.erase(p_shape);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2485,11 +2485,16 @@ void OS_Windows::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shap
|
|||||||
DeleteObject(bitmap);
|
DeleteObject(bitmap);
|
||||||
} else {
|
} else {
|
||||||
// Reset to default system cursor
|
// Reset to default system cursor
|
||||||
|
if (cursors[p_shape]) {
|
||||||
|
DestroyIcon(cursors[p_shape]);
|
||||||
cursors[p_shape] = NULL;
|
cursors[p_shape] = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
CursorShape c = cursor_shape;
|
CursorShape c = cursor_shape;
|
||||||
cursor_shape = CURSOR_MAX;
|
cursor_shape = CURSOR_MAX;
|
||||||
set_cursor_shape(c);
|
set_cursor_shape(c);
|
||||||
|
|
||||||
|
cursors_cache.erase(p_shape);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2996,6 +2996,8 @@ void OS_X11::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, c
|
|||||||
CursorShape c = current_cursor;
|
CursorShape c = current_cursor;
|
||||||
current_cursor = CURSOR_MAX;
|
current_cursor = CURSOR_MAX;
|
||||||
set_cursor_shape(c);
|
set_cursor_shape(c);
|
||||||
|
|
||||||
|
cursors_cache.erase(p_shape);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user