From 6f5d18a9f5c5ce28ed3bed98365967565dfa8b94 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 16 Oct 2022 23:45:28 -0400 Subject: [PATCH] macos: Fix clipboard data size handling We were using the allocated memory size, not the amount of data that has been written. Fixes: #5261 --- gdk/macos/gdkmacosclipboard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdk/macos/gdkmacosclipboard.c b/gdk/macos/gdkmacosclipboard.c index 25f4669efb..3a2667c0df 100644 --- a/gdk/macos/gdkmacosclipboard.c +++ b/gdk/macos/gdkmacosclipboard.c @@ -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 -- 2.30.2