2
0
Эх сурвалжийг харах

Fix Input::set_custom_mouse_cursor showing cursor when it's invisible

Guilherme Felipe 7 жил өмнө
parent
commit
72d4fd8f0d

+ 3 - 1
platform/osx/os_osx.mm

@@ -1272,7 +1272,9 @@ void OS_OSX::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, c
 		cursors[p_shape] = cursor;
 
 		if (p_shape == CURSOR_ARROW) {
-			[cursor set];
+			if (mouse_mode == MOUSE_MODE_VISIBLE) {
+				[cursor set];
+			}
 		}
 
 		[imgrep release];

+ 3 - 1
platform/windows/os_windows.cpp

@@ -2059,7 +2059,9 @@ void OS_Windows::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shap
 		cursors[p_shape] = CreateIconIndirect(&iconinfo);
 
 		if (p_shape == CURSOR_ARROW) {
-			SetCursor(cursors[p_shape]);
+			if (mouse_mode == MOUSE_MODE_VISIBLE) {
+				SetCursor(cursors[p_shape]);
+			}
 		}
 
 		if (hAndMask != NULL) {

+ 3 - 1
platform/x11/os_x11.cpp

@@ -2218,7 +2218,9 @@ void OS_X11::set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, c
 		cursors[p_shape] = XcursorImageLoadCursor(x11_display, cursor_image);
 
 		if (p_shape == CURSOR_ARROW) {
-			XDefineCursor(x11_display, x11_window, cursors[p_shape]);
+			if (mouse_mode == MOUSE_MODE_VISIBLE) {
+				XDefineCursor(x11_display, x11_window, cursors[p_shape]);
+			}
 		}
 
 		memfree(cursor_image->pixels);