diff options
author | Juan Linietsky <juan@godotengine.org> | 2019-03-04 10:26:48 -0300 |
---|---|---|
committer | Juan Linietsky <juan@godotengine.org> | 2019-03-04 10:26:48 -0300 |
commit | 03cafd489504f91cc9e36f954b00fc25fa17b1d5 (patch) | |
tree | d783ff0abf41527e3f602ea6cc106953e19c73af | |
parent | 9dd9737cb43dc871661945adcc1784756f28a118 (diff) |
Update focus mask only if there is a focused control, fixes #26524
-rw-r--r-- | scene/main/viewport.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 5bfdb5a9fd..d86c241ec6 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1783,13 +1783,15 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) { */ gui.mouse_focus = _gui_find_control(pos); - gui.mouse_focus_mask = 1 << (mb->get_button_index() - 1); gui.last_mouse_focus = gui.mouse_focus; if (!gui.mouse_focus) { + gui.mouse_focus_mask = 0; return; } + gui.mouse_focus_mask = 1 << (mb->get_button_index() - 1); + if (mb->get_button_index() == BUTTON_LEFT) { gui.drag_accum = Vector2(); gui.drag_attempted = false; |