From 7118fb9cda6e79b7525a6f200d4492410cd37066 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Tue, 26 Mar 2024 18:40:19 +0800 Subject: [PATCH] Return ERR_UNAVAILABLE if native dialog is not supported --- servers/display_server.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/servers/display_server.cpp b/servers/display_server.cpp index 72228c25f26..8e6c6595659 100644 --- a/servers/display_server.cpp +++ b/servers/display_server.cpp @@ -645,22 +645,22 @@ void DisplayServer::enable_for_stealing_focus(OS::ProcessID pid) { Error DisplayServer::dialog_show(String p_title, String p_description, Vector p_buttons, const Callable &p_callback) { WARN_PRINT("Native dialogs not supported by this display server."); - return OK; + return ERR_UNAVAILABLE; } Error DisplayServer::dialog_input_text(String p_title, String p_description, String p_partial, const Callable &p_callback) { WARN_PRINT("Native dialogs not supported by this display server."); - return OK; + return ERR_UNAVAILABLE; } Error DisplayServer::file_dialog_show(const String &p_title, const String &p_current_directory, const String &p_filename, bool p_show_hidden, FileDialogMode p_mode, const Vector &p_filters, const Callable &p_callback) { WARN_PRINT("Native dialogs not supported by this display server."); - return OK; + return ERR_UNAVAILABLE; } Error DisplayServer::file_dialog_with_options_show(const String &p_title, const String &p_current_directory, const String &p_root, const String &p_filename, bool p_show_hidden, FileDialogMode p_mode, const Vector &p_filters, const TypedArray &p_options, const Callable &p_callback) { WARN_PRINT("Native dialogs not supported by this display server."); - return OK; + return ERR_UNAVAILABLE; } int DisplayServer::keyboard_get_layout_count() const {