diff options
Diffstat (limited to 'scene/gui/control.cpp')
-rw-r--r-- | scene/gui/control.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index ae94be8437..dc9294df6d 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -2225,7 +2225,19 @@ void Control::_window_find_focus_neighbor(const Vector2 &p_dir, Node *p_at, cons void Control::set_default_cursor_shape(CursorShape p_shape) { ERR_FAIL_INDEX(int(p_shape), CURSOR_MAX); + if (data.default_cursor == p_shape) { + return; + } data.default_cursor = p_shape; + + if (!is_inside_tree()) { + return; + } + if (!get_global_rect().has_point(get_global_mouse_position())) { + return; + } + + get_viewport()->get_base_window()->update_mouse_cursor_shape(); } Control::CursorShape Control::get_default_cursor_shape() const { |