From e18107a57ccaf3d93a8893fe36f6d9010e2cdef1 Mon Sep 17 00:00:00 2001 From: Markus Sauermann <6299227+Sauermann@users.noreply.github.com> Date: Mon, 17 Oct 2022 00:59:51 +0200 Subject: Fix Determining Window for Touchscreen DisplayServer::screen_is_touchscreen will likely never utilize its parameter p_screen. This PR replaces this function by DisplayServer::is_touchscreen_available() with the same functionality. This solves the problem, that a SubViewport was used for determining the screen, which resulted in error messages. --- platform/web/display_server_web.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'platform/web/display_server_web.cpp') diff --git a/platform/web/display_server_web.cpp b/platform/web/display_server_web.cpp index f704124704..180baff02e 100644 --- a/platform/web/display_server_web.cpp +++ b/platform/web/display_server_web.cpp @@ -579,8 +579,8 @@ void DisplayServerWeb::touch_callback(int p_type, int p_count) { } } -bool DisplayServerWeb::screen_is_touchscreen(int p_screen) const { - return godot_js_display_touchscreen_is_available(); +bool DisplayServerWeb::is_touchscreen_available() const { + return godot_js_display_touchscreen_is_available() || (Input::get_singleton() && Input::get_singleton()->is_emulating_touch_from_mouse()); } // Virtual Keyboard -- cgit v1.2.3