From f52da158d9421b1c3109b59ed99968d766875234 Mon Sep 17 00:00:00 2001 From: Marc Gilleron Date: Sun, 10 Dec 2017 02:25:39 +0100 Subject: Fix mouse button release not sent to gui_input if it's different from the button that gave focus --- scene/main/viewport.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scene') diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index ea8adc58cd..2f75ff7936 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1800,7 +1800,8 @@ void Viewport::_gui_input_event(Ref p_event) { _gui_call_input(gui.mouse_focus, mb); } - if (mb->get_button_index() == gui.mouse_focus_button) { + if (mb->get_button_mask() == 0) { + // Last mouse button was released gui.mouse_focus = NULL; gui.mouse_focus_button = -1; } -- cgit v1.2.3