diff options
author | Markus Sauermann <6299227+Sauermann@users.noreply.github.com> | 2022-10-17 00:59:51 +0200 |
---|---|---|
committer | Markus Sauermann <6299227+Sauermann@users.noreply.github.com> | 2022-12-07 09:54:29 +0100 |
commit | e18107a57ccaf3d93a8893fe36f6d9010e2cdef1 (patch) | |
tree | 3828f136f7dd6a96e8d9565438343ea0ab5f58e0 /platform/android | |
parent | c241f1c52386b21cf2df936ee927740a06970db6 (diff) |
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.
Diffstat (limited to 'platform/android')
-rw-r--r-- | platform/android/display_server_android.cpp | 2 | ||||
-rw-r--r-- | platform/android/display_server_android.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/platform/android/display_server_android.cpp b/platform/android/display_server_android.cpp index 937b929d62..1e2f35381b 100644 --- a/platform/android/display_server_android.cpp +++ b/platform/android/display_server_android.cpp @@ -221,7 +221,7 @@ float DisplayServerAndroid::screen_get_refresh_rate(int p_screen) const { return godot_io_java->get_screen_refresh_rate(SCREEN_REFRESH_RATE_FALLBACK); } -bool DisplayServerAndroid::screen_is_touchscreen(int p_screen) const { +bool DisplayServerAndroid::is_touchscreen_available() const { return true; } diff --git a/platform/android/display_server_android.h b/platform/android/display_server_android.h index c7f4d8046f..c1c11d6cba 100644 --- a/platform/android/display_server_android.h +++ b/platform/android/display_server_android.h @@ -121,7 +121,7 @@ public: virtual int screen_get_dpi(int p_screen = SCREEN_OF_MAIN_WINDOW) const override; virtual float screen_get_scale(int p_screen = SCREEN_OF_MAIN_WINDOW) const override; virtual float screen_get_refresh_rate(int p_screen = SCREEN_OF_MAIN_WINDOW) const override; - virtual bool screen_is_touchscreen(int p_screen = SCREEN_OF_MAIN_WINDOW) const override; + virtual bool is_touchscreen_available() const override; virtual void virtual_keyboard_show(const String &p_existing_text, const Rect2 &p_screen_rect = Rect2(), VirtualKeyboardType p_type = KEYBOARD_TYPE_DEFAULT, int p_max_length = -1, int p_cursor_start = -1, int p_cursor_end = -1) override; virtual void virtual_keyboard_hide() override; |