summaryrefslogtreecommitdiff
path: root/scene/gui/rich_text_label.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-10-23 19:13:34 +0200
committerGitHub <noreply@github.com>2021-10-23 19:13:34 +0200
commitb2ab5cb504cef1ffe229523d63b997d5306afce3 (patch)
tree9a1ed92c989066c9dd266b7376c49d06b5d09b82 /scene/gui/rich_text_label.cpp
parente0f887accdd01fc8bb350b09e1e2b663320ac612 (diff)
parent8c48b4a7e0dbe724a461bb8a44a7a8b029f9f609 (diff)
Merge pull request #54045 from ConteZero/primary_clipboard_linux_fix_warning
Diffstat (limited to 'scene/gui/rich_text_label.cpp')
-rw-r--r--scene/gui/rich_text_label.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index b3788f6317..31767dd263 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -1596,14 +1596,16 @@ void RichTextLabel::gui_input(const Ref<InputEvent> &p_event) {
selection.to_char = words[i + 1];
selection.active = true;
- DisplayServer::get_singleton()->clipboard_set_primary(get_selected_text());
+ if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_CLIPBOARD_PRIMARY)) {
+ DisplayServer::get_singleton()->clipboard_set_primary(get_selected_text());
+ }
update();
break;
}
}
}
} else if (!b->is_pressed()) {
- if (selection.enabled) {
+ if (selection.enabled && DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_CLIPBOARD_PRIMARY)) {
DisplayServer::get_singleton()->clipboard_set_primary(get_selected_text());
}
selection.click_item = nullptr;