diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-05-02 10:47:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-02 10:47:49 +0200 |
commit | 18c28c159d12c9d3227c2199998b271f7c5e5998 (patch) | |
tree | ba3591964e6dea9d06daa5aaea399fa53a8c2c8e /scene | |
parent | 04a4270a3485bcc4bd1ce8f7095fe9ea36bc5518 (diff) | |
parent | de9d40a9537bafa613dc54f2200b7509ad6fa9e3 (diff) |
Merge pull request #17196 from RandomShaper/improve-gui-touch
Implement universal translation of touch to mouse (3.1)
Diffstat (limited to 'scene')
-rw-r--r-- | scene/main/scene_tree.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index 4419dfe70f..727807dbcd 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -33,6 +33,7 @@ #include "editor/editor_node.h" #include "io/marshalls.h" #include "io/resource_loader.h" +#include "main/input_default.h" #include "message_queue.h" #include "node.h" #include "os/keyboard.h" @@ -620,6 +621,13 @@ void SceneTree::_notification(int p_notification) { case NOTIFICATION_WM_FOCUS_IN: case NOTIFICATION_WM_FOCUS_OUT: { + if (p_notification == NOTIFICATION_WM_FOCUS_IN) { + InputDefault *id = Object::cast_to<InputDefault>(Input::get_singleton()); + if (id) { + id->ensure_touch_mouse_raised(); + } + } + get_root()->propagate_notification(p_notification); } break; case NOTIFICATION_TRANSLATION_CHANGED: { |