diff options
Diffstat (limited to 'servers/display_server.cpp')
-rw-r--r-- | servers/display_server.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/servers/display_server.cpp b/servers/display_server.cpp index eb12b5ffc0..d4ff42bc34 100644 --- a/servers/display_server.cpp +++ b/servers/display_server.cpp @@ -155,6 +155,10 @@ String DisplayServer::clipboard_get() const { ERR_FAIL_V_MSG(String(), "Clipboard is not supported by this display server."); } +bool DisplayServer::clipboard_has() const { + return !clipboard_get().is_empty(); +} + void DisplayServer::clipboard_set_primary(const String &p_text) { WARN_PRINT("Primary clipboard is not supported by this display server."); } @@ -359,6 +363,7 @@ void DisplayServer::_bind_methods() { ClassDB::bind_method(D_METHOD("clipboard_set", "clipboard"), &DisplayServer::clipboard_set); ClassDB::bind_method(D_METHOD("clipboard_get"), &DisplayServer::clipboard_get); + ClassDB::bind_method(D_METHOD("clipboard_has"), &DisplayServer::clipboard_has); ClassDB::bind_method(D_METHOD("clipboard_set_primary", "clipboard_primary"), &DisplayServer::clipboard_set_primary); ClassDB::bind_method(D_METHOD("clipboard_get_primary"), &DisplayServer::clipboard_get_primary); |