macos: Fix clipboard data size handling

We were using the allocated memory size, not
the amount of data that has been written.

Fixes: #5261
This commit is contained in:
Matthias Clasen 2022-10-16 23:45:28 -04:00
parent 004f22a51c
commit 6f5d18a9f5

View File

@ -440,7 +440,7 @@ on_data_ready_cb (GObject *object,
g_output_stream_close (G_OUTPUT_STREAM (wr->stream), NULL, NULL);
size = g_memory_output_stream_get_size (wr->stream);
size = g_memory_output_stream_get_data_size (wr->stream);
bytes = g_memory_output_stream_steal_data (wr->stream);
data = [[NSData alloc] initWithBytesNoCopy:bytes
length:size