Repository: godotengine/godot
File: scene/gui/control.cpp (C++)

Code before:
	const Node *ctx_node = get_shortcut_context();
	const Control *vp_focus = get_viewport() ? get_viewport()->gui_get_focus_owner() : nullptr;

	// If the context is valid and the viewport focus is valid, check if the context is the focus or is a parent of it.
	return ctx_node && vp_focus && (ctx_node == vp_focus || ctx_node->is_ancestor_of(vp_focus));
}

// Drag and drop handling.

void Control::set_drag_forwarding(Object *p_target) {
	if (p_target) {
		data.drag_owner = p_target->get_instance_id();
	} else {
		data.drag_owner = ObjectID();
	}
}

Variant Control::get_drag_data(const Point2 &p_point) {
	if (data.drag_owner.is_valid()) {
		Object *obj = ObjectDB::get_instance(data.drag_owner);
		if (obj) {
			return obj->call("_get_drag_data_fw", p_point, this);
		}
	}

	Variant dd;
	GDVIRTUAL_CALL(_get_drag_data, p_point, dd);
	return dd;
}

bool Control::can_drop_data(const Point2 &p_point, const Variant &p_data) const {
	if (data.drag_owner.is_valid()) {
		Object *obj = ObjectDB::get_instance(data.drag_owner);
		if (obj) {
			return obj->call("_can_drop_data_fw", p_point, p_data, this);
		}
	}

	bool ret = false;
	GDVIRTUAL_CALL(_can_drop_data, p_point, p_data, ret);
	return ret;
}

void Control::drop_data(const Point2 &p_point, const Variant &p_data) {
	if (data.drag_owner.is_valid()) {
		Object *obj = ObjectDB::get_instance(data.drag_owner);
		if (obj) {
			obj->call("_drop_data_fw", p_point, p_data, this);
			return;
		}
	}

Review comment (suggestion):
```suggestion
	data.forward_drop = p_drop;
```
Typo.

Code after:
	const Node *ctx_node = get_shortcut_context();
	const Control *vp_focus = get_viewport() ? get_viewport()->gui_get_focus_owner() : nullptr;

	// If the context is valid and the viewport focus is valid, check if the context is the focus or is a parent of it.
	return ctx_node && vp_focus && (ctx_node == vp_focus || ctx_node->is_ancestor_of(vp_focus));
}

// Drag and drop handling.

void Control::set_drag_forwarding_compat(Object *p_base) {
	if (p_base != nullptr) {
		data.forward_drag = Callable(p_base, "_get_drag_data_fw").bind(this);
		data.forward_can_drop = Callable(p_base, "_can_drop_data_fw").bind(this);
		data.forward_drop = Callable(p_base, "_drop_data_fw").bind(this);

	} else {
		data.forward_drag = Callable();
		data.forward_can_drop = Callable();
		data.forward_drop = Callable();
	}
}

void Control::set_drag_forwarding(const Callable &p_drag, const Callable &p_can_drop, const Callable &p_drop) {
	data.forward_drag = p_drag;
	data.forward_can_drop = p_can_drop;
	data.forward_drop = p_drop;
}

Variant Control::get_drag_data(const Point2 &p_point) {
	Variant ret;
	if (data.forward_drag.is_valid()) {
		Variant p = p_point;
		const Variant *vp[1] = { &p };
		Callable::CallError ce;
		data.forward_drag.callp((const Variant **)vp, 1, ret, ce);
		if (ce.error != Callable::CallError::CALL_OK) {
			ERR_FAIL_V_MSG(Variant(), "Error calling forwarded method from 'get_drag_data': " + Variant::get_callable_error_text(data.forward_drag, (const Variant **)vp, 1, ce) + ".");
		}
		return ret;
	}

	GDVIRTUAL_CALL(_get_drag_data, p_point, ret);
	return ret;
}

bool Control::can_drop_data(const Point2 &p_point, const Variant &p_data) const {
	if (data.forward_can_drop.is_valid()) {
		Variant ret;
		Variant p = p_point;
		const Variant *vp[2] = { &p, &p_data };
		Callable::CallError ce;