summaryrefslogtreecommitdiff
path: root/scene/main/window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/main/window.cpp')
-rw-r--r--scene/main/window.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/scene/main/window.cpp b/scene/main/window.cpp
index 6837fcae21..a1124274d8 100644
--- a/scene/main/window.cpp
+++ b/scene/main/window.cpp
@@ -378,6 +378,18 @@ void Window::_event_callback(DisplayServer::WindowEvent p_event) {
}
}
+void Window::update_mouse_cursor_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.
+ Ref<InputEventMouseMotion> mm;
+ Vector2 pos = get_mouse_position();
+ Transform2D xform = get_global_canvas_transform().affine_inverse();
+ mm.instantiate();
+ mm->set_position(pos);
+ mm->set_global_position(xform.xform(pos));
+ push_input(mm);
+}
+
void Window::show() {
set_visible(true);
}