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. --- main/main.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'main') diff --git a/main/main.cpp b/main/main.cpp index c2e2238482..fd1dfabb1b 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -2233,13 +2233,7 @@ Error Main::setup2(Thread::ID p_main_tid_override) { if (bool(GLOBAL_DEF("input_devices/pointing/emulate_touch_from_mouse", false)) && !(editor || project_manager)) { - bool found_touchscreen = false; - for (int i = 0; i < DisplayServer::get_singleton()->get_screen_count(); i++) { - if (DisplayServer::get_singleton()->screen_is_touchscreen(i)) { - found_touchscreen = true; - } - } - if (!found_touchscreen) { + if (!DisplayServer::get_singleton()->is_touchscreen_available()) { //only if no touchscreen ui hint, set emulation id->set_emulate_touch_from_mouse(true); } -- cgit v1.2.3