Merge pull request #30931 from guilhermefelipecgs/fix_30917

Fix set_default_cursor_shape always sending motion event
This commit is contained in:
Rémi Verschelde 2019-07-29 19:31:26 +02:00 committed by GitHub
commit cc0e5e51b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View file

@ -318,6 +318,7 @@
<description>
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.
</description>
</method>
<method name="set_mouse_mode">

View file

@ -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.