From 0fce98b4b5f568298477b175c70510924793f6b0 Mon Sep 17 00:00:00 2001 From: Markus Sauermann <6299227+Sauermann@users.noreply.github.com> Date: Wed, 9 Mar 2022 01:04:56 +0100 Subject: Update mouse cursor shape after changes This fixes some cases where the mouse cursor shape did not change automatically, but instead required a MouseMove to update. --- scene/gui/control.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'scene/gui/control.cpp') diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index d8659b1f18..2866a5ad6c 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -2663,6 +2663,11 @@ void Control::set_default_cursor_shape(CursorShape p_shape) { ERR_FAIL_INDEX(int(p_shape), CURSOR_MAX); data.default_cursor = p_shape; + + if (!is_inside_tree()) { + return; + } + get_viewport()->get_base_window()->update_mouse_cursor_shape(); } Control::CursorShape Control::get_default_cursor_shape() const { -- cgit v1.2.3