You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
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.
This commit is contained in:
@@ -6038,14 +6038,7 @@ EditorNode::EditorNode() {
|
||||
Input *id = Input::get_singleton();
|
||||
|
||||
if (id) {
|
||||
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 && Input::get_singleton()) {
|
||||
if (!DisplayServer::get_singleton()->is_touchscreen_available() && Input::get_singleton()) {
|
||||
// Only if no touchscreen ui hint, disable emulation just in case.
|
||||
id->set_emulate_touch_from_mouse(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user