diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-10-14 13:31:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-14 13:31:11 +0200 |
commit | 39534a7aecc4ca4215af67244b23dda09ea339f8 (patch) | |
tree | 99958edcae5b888b9aecc0b4673b3b2188ad7f03 /scene/main | |
parent | dfdca6300f7ce5163b438d7b133874b88ce2243c (diff) | |
parent | b1d6b346626c2e6199306d45c77231e383fe54a0 (diff) |
Merge pull request #67385 from Sauermann/fix-viewport-mouse-position-update-on-subwindows
Diffstat (limited to 'scene/main')
-rw-r--r-- | scene/main/viewport.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index f7a515dc1d..f66337a2f9 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1490,7 +1490,6 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) { gui.key_event_accepted = false; Point2 mpos = mb->get_position(); - gui.last_mouse_pos = mpos; if (mb->is_pressed()) { Size2 pos = mpos; if (gui.mouse_focus_mask != MouseButton::NONE) { @@ -1644,8 +1643,6 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) { gui.key_event_accepted = false; Point2 mpos = mm->get_position(); - gui.last_mouse_pos = mpos; - // Drag & drop. if (!gui.drag_attempted && gui.mouse_focus && (mm->get_button_mask() & MouseButton::MASK_LEFT) != MouseButton::NONE) { gui.drag_accum += mm->get_relative(); @@ -2759,6 +2756,11 @@ void Viewport::push_input(const Ref<InputEvent> &p_event, bool p_local_coords) { ev = p_event; } + Ref<InputEventMouse> me = ev; + if (me.is_valid()) { + gui.last_mouse_pos = me->get_position(); + } + if (is_embedding_subwindows() && _sub_windows_forward_input(ev)) { set_input_as_handled(); return; |