diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml index bbf1ee186f1..f938cd07572 100644 --- a/doc/classes/Input.xml +++ b/doc/classes/Input.xml @@ -318,6 +318,7 @@ Sets the default cursor shape to be used in the viewport instead of [constant CURSOR_ARROW]. [b]Note:[/b] If you want to change the default cursor shape for [Control]'s nodes, use [member Control.mouse_default_cursor_shape] instead. + [b]Note:[/b] This method generates an [InputEventMouseMotion] to update cursor immediately. diff --git a/main/input_default.cpp b/main/input_default.cpp index caa5c10518b..5ba98c20e2e 100644 --- a/main/input_default.cpp +++ b/main/input_default.cpp @@ -629,6 +629,10 @@ Input::CursorShape InputDefault::get_default_cursor_shape() const { } void InputDefault::set_default_cursor_shape(CursorShape p_shape) { + + if (default_shape == p_shape) + return; + default_shape = p_shape; // The default shape is set in Viewport::_gui_input_event. To instantly // see the shape in the viewport we need to trigger a mouse motion event.