Skip to content

Commit

Permalink
Fix clipboard copy functionality not working
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-ancell committed Jul 3, 2020
1 parent acd026e commit 72cadb1
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions shell/platform/linux/fl_platform_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ static constexpr char kChannelName[] = "flutter/platform";
static constexpr char kBadArgumentsError[] = "Bad Arguments";
static constexpr char kUnknownClipboardFormatError[] =
"Unknown Clipboard Format";
static constexpr char kClipboardRequestError[] = "Clipboard Request Failed";
static constexpr char kFailedError[] = "Failed";
static constexpr char kGetClipboardDataMethod[] = "Clipboard.getData";
static constexpr char kSetClipboardDataMethod[] = "Clipboard.setData";
Expand Down Expand Up @@ -47,11 +46,9 @@ static void clipboard_text_cb(GtkClipboard* clipboard,
if (text != nullptr) {
g_autoptr(FlValue) result = fl_value_new_map();
fl_value_set_string_take(result, kTextKey, fl_value_new_string(text));
response = FL_METHOD_RESPONSE(fl_method_success_response_new(nullptr));
response = FL_METHOD_RESPONSE(fl_method_success_response_new(result));
} else {
response = FL_METHOD_RESPONSE(fl_method_error_response_new(
kClipboardRequestError, "Failed to retrieve clipboard text from GTK",
nullptr));
response = FL_METHOD_RESPONSE(fl_method_success_response_new(nullptr));
}

send_response(method_call, response);
Expand Down

0 comments on commit 72cadb1

Please sign in to comment.