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:
parent
c241f1c523
commit
e18107a57c
16 changed files with 25 additions and 40 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ public:
|
|||
virtual Point2i mouse_get_position() const override;
|
||||
|
||||
// touch
|
||||
virtual bool screen_is_touchscreen(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
|
||||
virtual bool is_touchscreen_available() const override;
|
||||
|
||||
// clipboard
|
||||
virtual void clipboard_set(const String &p_text) override;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue