diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 07e7273343f..522dc74661b 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1734,7 +1734,6 @@ void Viewport::_gui_input_event(Ref p_event) { gui.mouse_focus_mask.set_flag(button_mask); } else { gui.mouse_focus = gui_find_control(mpos); - gui.last_mouse_focus = gui.mouse_focus; if (!gui.mouse_focus) { return; @@ -2391,9 +2390,6 @@ void Viewport::_gui_remove_control(Control *p_control) { gui.forced_mouse_focus = false; gui.mouse_focus_mask.clear(); } - if (gui.last_mouse_focus == p_control) { - gui.last_mouse_focus = nullptr; - } if (gui.key_focus == p_control) { gui.key_focus = nullptr; } diff --git a/scene/main/viewport.h b/scene/main/viewport.h index c6a757acd06..394d48143c9 100644 --- a/scene/main/viewport.h +++ b/scene/main/viewport.h @@ -345,7 +345,6 @@ private: bool key_event_accepted = false; HashMap touch_focus; Control *mouse_focus = nullptr; - Control *last_mouse_focus = nullptr; Control *mouse_click_grabber = nullptr; BitField mouse_focus_mask; Control *key_focus = nullptr;