summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-09-25 15:23:47 +0200
committerGitHub <noreply@github.com>2019-09-25 15:23:47 +0200
commit351c45a4612749da81ffa26783d44880aa1edd7a (patch)
treee18997b655aedd0caf092e1bfb0e487551be3a19 /scene
parentc52287208d0a2e1c83665b7b268b58772acfc6db (diff)
parentb8007b39474ff3f5beca80123009d57a83b236c3 (diff)
Merge pull request #32047 from codecustard/fix_scrollwheel_triggering_focus_change
Fix scrollwheel triggering focus change
Diffstat (limited to 'scene')
-rw-r--r--scene/main/viewport.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 04278b2902..39c5759871 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -1742,6 +1742,12 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
return; // no one gets the event if exclusive NO ONE
}
+ if (mb->get_button_index() == BUTTON_WHEEL_UP || mb->get_button_index() == BUTTON_WHEEL_DOWN || mb->get_button_index() == BUTTON_WHEEL_LEFT || mb->get_button_index() == BUTTON_WHEEL_RIGHT) {
+ //cancel scroll wheel events, only clicks should trigger focus changes.
+ set_input_as_handled();
+ return;
+ }
+
top->notification(Control::NOTIFICATION_MODAL_CLOSE);
top->_modal_stack_remove();
top->hide();