From fa02d19fd170d050bb47c4e525061bf96afdb62a Mon Sep 17 00:00:00 2001 From: Markus Sauermann <6299227+Sauermann@users.noreply.github.com> Date: Fri, 1 Sep 2023 08:40:35 +0200 Subject: Fix internal events not being delivered to some Window types `AcceptDialog`, `Popup` and `PopupMenu` no longer subscribe to "window_input" signal, because that is only sent if it is not an internal signal. Instead they receive events in `_input_from_window`. They ensure that the event is also propagated to their super-function, just like previously the signals would be treated. --- scene/main/window.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'scene/main/window.cpp') diff --git a/scene/main/window.cpp b/scene/main/window.cpp index 2c28dc31d6..0d554de6f4 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -1543,7 +1543,12 @@ void Window::_window_input(const Ref &p_ev) { } } - if (p_ev->get_device() != InputEvent::DEVICE_ID_INTERNAL) { + // If the event needs to be handled in a Window-derived class, then it should overwrite + // `_input_from_window` instead of subscribing to the `window_input` signal, because the signal + // filters out internal events. + _input_from_window(p_ev); + + if (p_ev->get_device() != InputEvent::DEVICE_ID_INTERNAL && is_inside_tree()) { emit_signal(SceneStringNames::get_singleton()->window_input, p_ev); } -- cgit v1.2.3