diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index df668aa496ce..c940238c5290 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -263,6 +263,10 @@ void LineEdit::gui_input(const Ref &p_event) { if (is_middle_mouse_paste_enabled() && b->is_pressed() && b->get_button_index() == MouseButton::MIDDLE && is_editable() && DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_CLIPBOARD_PRIMARY)) { String paste_buffer = DisplayServer::get_singleton()->clipboard_get_primary().strip_escapes(); + if (DisplayServer::get_singleton()->get_name() == "Wayland") { + paste_buffer = DisplayServer::get_singleton()->clipboard_get(); + } + deselect(); set_caret_at_pixel_pos(b->get_position().x); if (!paste_buffer.is_empty()) { diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index a2f39af85895..9b7f73d91bb7 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -7227,6 +7227,10 @@ void TextEdit::_paste_primary_clipboard_internal(int p_caret) { String paste_buffer = DisplayServer::get_singleton()->clipboard_get_primary(); + if (DisplayServer::get_singleton()->get_name() == "Wayland") { + paste_buffer = DisplayServer::get_singleton()->clipboard_get(); + } + if (get_caret_count() == 1) { Point2i pos = get_line_column_at_pos(get_local_mouse_pos()); deselect();