Преглед изворни кода

Fix push_input only working the first time

Subviewports didn't update their parent's local_input_handled correctly.

Fixes #76439.
Jummit пре 2 година
родитељ
комит
7957354091
1 измењених фајлова са 10 додато и 0 уклоњено
  1. 10 0
      scene/main/viewport.cpp

+ 10 - 0
scene/main/viewport.cpp

@@ -2945,6 +2945,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) {