You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-14 13:41:12 +00:00
Merge pull request #22187 from guilhermefelipecgs/fix_20177
[2.1] Fix Input::set_custom_mouse_cursor showing cursor when it's invisible
This commit is contained in:
@@ -1272,8 +1272,10 @@ void OS_OSX::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, c
|
|||||||
cursors[p_shape] = cursor;
|
cursors[p_shape] = cursor;
|
||||||
|
|
||||||
if (p_shape == CURSOR_ARROW) {
|
if (p_shape == CURSOR_ARROW) {
|
||||||
|
if (mouse_mode == MOUSE_MODE_VISIBLE) {
|
||||||
[cursor set];
|
[cursor set];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[imgrep release];
|
[imgrep release];
|
||||||
[nsimage release];
|
[nsimage release];
|
||||||
|
|||||||
@@ -2059,8 +2059,10 @@ void OS_Windows::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shap
|
|||||||
cursors[p_shape] = CreateIconIndirect(&iconinfo);
|
cursors[p_shape] = CreateIconIndirect(&iconinfo);
|
||||||
|
|
||||||
if (p_shape == CURSOR_ARROW) {
|
if (p_shape == CURSOR_ARROW) {
|
||||||
|
if (mouse_mode == MOUSE_MODE_VISIBLE) {
|
||||||
SetCursor(cursors[p_shape]);
|
SetCursor(cursors[p_shape]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (hAndMask != NULL) {
|
if (hAndMask != NULL) {
|
||||||
DeleteObject(hAndMask);
|
DeleteObject(hAndMask);
|
||||||
|
|||||||
@@ -2218,8 +2218,10 @@ void OS_X11::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, c
|
|||||||
cursors[p_shape] = XcursorImageLoadCursor(x11_display, cursor_image);
|
cursors[p_shape] = XcursorImageLoadCursor(x11_display, cursor_image);
|
||||||
|
|
||||||
if (p_shape == CURSOR_ARROW) {
|
if (p_shape == CURSOR_ARROW) {
|
||||||
|
if (mouse_mode == MOUSE_MODE_VISIBLE) {
|
||||||
XDefineCursor(x11_display, x11_window, cursors[p_shape]);
|
XDefineCursor(x11_display, x11_window, cursors[p_shape]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
memfree(cursor_image->pixels);
|
memfree(cursor_image->pixels);
|
||||||
XcursorImageDestroy(cursor_image);
|
XcursorImageDestroy(cursor_image);
|
||||||
|
|||||||
Reference in New Issue
Block a user