diff options
Diffstat (limited to 'scene/gui/control.cpp')
| -rw-r--r-- | scene/gui/control.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index ae94be8437..2dcae2553c 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -1793,7 +1793,7 @@ bool Control::can_drop_data(const Point2 &p_point, const Variant &p_data) const } } - bool ret; + bool ret = false; if (GDVIRTUAL_CALL(_can_drop_data, p_point, p_data, ret)) { return ret; } @@ -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 { |