Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 72cadb1

Browse files
committed
Fix clipboard copy functionality not working
Fixes flutter/flutter#60729
1 parent acd026e commit 72cadb1

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

shell/platform/linux/fl_platform_plugin.cc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ static constexpr char kChannelName[] = "flutter/platform";
1212
static constexpr char kBadArgumentsError[] = "Bad Arguments";
1313
static constexpr char kUnknownClipboardFormatError[] =
1414
"Unknown Clipboard Format";
15-
static constexpr char kClipboardRequestError[] = "Clipboard Request Failed";
1615
static constexpr char kFailedError[] = "Failed";
1716
static constexpr char kGetClipboardDataMethod[] = "Clipboard.getData";
1817
static constexpr char kSetClipboardDataMethod[] = "Clipboard.setData";
@@ -47,11 +46,9 @@ static void clipboard_text_cb(GtkClipboard* clipboard,
4746
if (text != nullptr) {
4847
g_autoptr(FlValue) result = fl_value_new_map();
4948
fl_value_set_string_take(result, kTextKey, fl_value_new_string(text));
50-
response = FL_METHOD_RESPONSE(fl_method_success_response_new(nullptr));
49+
response = FL_METHOD_RESPONSE(fl_method_success_response_new(result));
5150
} else {
52-
response = FL_METHOD_RESPONSE(fl_method_error_response_new(
53-
kClipboardRequestError, "Failed to retrieve clipboard text from GTK",
54-
nullptr));
51+
response = FL_METHOD_RESPONSE(fl_method_success_response_new(nullptr));
5552
}
5653

5754
send_response(method_call, response);

0 commit comments

Comments
 (0)