From 4396e98834f159da59ec790f2ff64fb65dacd9ce Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 1 Mar 2020 19:14:37 -0300 Subject: Refactored Input, create DisplayServer and DisplayServerX11 --- scene/2d/touch_screen_button.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scene/2d/touch_screen_button.cpp') diff --git a/scene/2d/touch_screen_button.cpp b/scene/2d/touch_screen_button.cpp index 1cca45b422..20d73113dc 100644 --- a/scene/2d/touch_screen_button.cpp +++ b/scene/2d/touch_screen_button.cpp @@ -30,8 +30,8 @@ #include "touch_screen_button.h" -#include "core/input_map.h" -#include "core/os/input.h" +#include "core/input/input.h" +#include "core/input/input_map.h" #include "core/os/os.h" void TouchScreenButton::set_texture(const Ref &p_texture) { -- cgit v1.2.3 From f8a79a97c7d12da43b111a756f09ee7ad5ea28e9 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 3 Mar 2020 10:36:29 -0300 Subject: Effective DisplayServer separation, rename X11 -> LinuxBSD --- scene/2d/touch_screen_button.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scene/2d/touch_screen_button.cpp') diff --git a/scene/2d/touch_screen_button.cpp b/scene/2d/touch_screen_button.cpp index 20d73113dc..0f79e12275 100644 --- a/scene/2d/touch_screen_button.cpp +++ b/scene/2d/touch_screen_button.cpp @@ -33,6 +33,7 @@ #include "core/input/input.h" #include "core/input/input_map.h" #include "core/os/os.h" +#include "scene/main/viewport.h" void TouchScreenButton::set_texture(const Ref &p_texture) { @@ -114,7 +115,7 @@ void TouchScreenButton::_notification(int p_what) { if (!is_inside_tree()) return; - if (!Engine::get_singleton()->is_editor_hint() && !OS::get_singleton()->has_touchscreen_ui_hint() && visibility == VISIBILITY_TOUCHSCREEN_ONLY) + if (!Engine::get_singleton()->is_editor_hint() && !!DisplayServer::get_singleton()->screen_is_touchscreen(DisplayServer::get_singleton()->window_get_current_screen(get_viewport()->get_window_id())) && visibility == VISIBILITY_TOUCHSCREEN_ONLY) return; if (finger_pressed != -1) { @@ -145,7 +146,7 @@ void TouchScreenButton::_notification(int p_what) { } break; case NOTIFICATION_ENTER_TREE: { - if (!Engine::get_singleton()->is_editor_hint() && !OS::get_singleton()->has_touchscreen_ui_hint() && visibility == VISIBILITY_TOUCHSCREEN_ONLY) + if (!Engine::get_singleton()->is_editor_hint() && !!DisplayServer::get_singleton()->screen_is_touchscreen(DisplayServer::get_singleton()->window_get_current_screen(get_viewport()->get_window_id())) && visibility == VISIBILITY_TOUCHSCREEN_ONLY) return; update(); -- cgit v1.2.3 From 9e08742de81b062c30b7984900a55d5150a4bd17 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 3 Mar 2020 22:51:12 -0300 Subject: Added a Window node, and made it the scene root. Still a lot of work to do. --- scene/2d/touch_screen_button.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scene/2d/touch_screen_button.cpp') diff --git a/scene/2d/touch_screen_button.cpp b/scene/2d/touch_screen_button.cpp index 0f79e12275..7efc6479f9 100644 --- a/scene/2d/touch_screen_button.cpp +++ b/scene/2d/touch_screen_button.cpp @@ -33,7 +33,7 @@ #include "core/input/input.h" #include "core/input/input_map.h" #include "core/os/os.h" -#include "scene/main/viewport.h" +#include "scene/main/window.h" void TouchScreenButton::set_texture(const Ref &p_texture) { -- cgit v1.2.3 From 8e6960a69e0202cb1e6f3b3dc9f9bb34e1c1d889 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Wed, 4 Mar 2020 13:36:09 -0300 Subject: Refactored input, goes all via windows now. Also renamed Input to InputFilter because all it does is filter events. --- scene/2d/touch_screen_button.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'scene/2d/touch_screen_button.cpp') diff --git a/scene/2d/touch_screen_button.cpp b/scene/2d/touch_screen_button.cpp index 7efc6479f9..2cb979a0e0 100644 --- a/scene/2d/touch_screen_button.cpp +++ b/scene/2d/touch_screen_button.cpp @@ -30,11 +30,11 @@ #include "touch_screen_button.h" -#include "core/input/input.h" +#include "core/input/input_filter.h" #include "core/input/input_map.h" #include "core/os/os.h" #include "scene/main/window.h" - +# void TouchScreenButton::set_texture(const Ref &p_texture) { texture = p_texture; @@ -290,12 +290,12 @@ void TouchScreenButton::_press(int p_finger_pressed) { if (action != StringName()) { - Input::get_singleton()->action_press(action); + InputFilter::get_singleton()->action_press(action); Ref iea; iea.instance(); iea->set_action(action); iea->set_pressed(true); - get_tree()->input_event(iea); + get_viewport()->input(iea, true); } emit_signal("pressed"); @@ -308,14 +308,14 @@ void TouchScreenButton::_release(bool p_exiting_tree) { if (action != StringName()) { - Input::get_singleton()->action_release(action); + InputFilter::get_singleton()->action_release(action); if (!p_exiting_tree) { Ref iea; iea.instance(); iea->set_action(action); iea->set_pressed(false); - get_tree()->input_event(iea); + get_viewport()->input(iea, true); } } -- cgit v1.2.3