浏览代码

Merge pull request #77730 from Jummit/fix-subviewport-1

Fix `push_input` events not going through after first pressed mouse event
Yuri Sizov 1 年之前
父节点
当前提交
e0f8cf4acb
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. 10 0
      scene/main/viewport.cpp

+ 10 - 0
scene/main/viewport.cpp

@@ -3316,6 +3316,16 @@ void Viewport::push_input(const Ref<InputEvent> &p_event, bool p_local_coords) {
 	}
 
 	local_input_handled = false;
+	if (!handle_input_locally) {
+		Viewport *vp = this;
+		while (true) {
+			if (Object::cast_to<Window>(vp) || !vp->get_parent()) {
+				break;
+			}
+			vp = vp->get_parent()->get_viewport();
+		}
+		vp->local_input_handled = false;
+	}
 
 	Ref<InputEvent> ev;
 	if (!p_local_coords) {