summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorMarc Gilleron <marc.gilleron@gmail.com>2017-12-10 02:25:39 +0100
committerMarc Gilleron <marc.gilleron@gmail.com>2017-12-10 02:25:39 +0100
commitf52da158d9421b1c3109b59ed99968d766875234 (patch)
tree1f352ad344390df87bc670906b1fd691a0365215 /scene
parent028f959fb12562feaf7f2234f7cf0363ae8f4736 (diff)
Fix mouse button release not sent to gui_input if it's different from the button that gave focus
Diffstat (limited to 'scene')
-rw-r--r--scene/main/viewport.cpp3
1 files changed, 2 insertions, 1 deletions
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<InputEvent> 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;
}