From cd4a08ada375854bfadd9d6f3902a6ca26a69a8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Fri, 3 Dec 2021 13:19:53 +0100 Subject: [PATCH] Viewport: Fixup dragging code after a0fb66d The check was removed by mistake while cherry-picking. --- scene/main/viewport.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 95c9a883a81..ea5fd6ac5b3 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -2275,12 +2275,14 @@ void Viewport::_gui_input_event(Ref p_event) { set_input_as_handled(); - bool can_drop = _gui_drop(over, pos, true); + if (gui.drag_data.get_type() != Variant::NIL) { + bool can_drop = _gui_drop(over, pos, true); - if (!can_drop) { - OS::get_singleton()->set_cursor_shape(OS::CURSOR_FORBIDDEN); - } else { - OS::get_singleton()->set_cursor_shape(OS::CURSOR_CAN_DROP); + if (!can_drop) { + OS::get_singleton()->set_cursor_shape(OS::CURSOR_FORBIDDEN); + } else { + OS::get_singleton()->set_cursor_shape(OS::CURSOR_CAN_DROP); + } } }