From: Matthias Clasen Date: Mon, 17 Oct 2022 03:45:28 +0000 (-0400) Subject: macos: Fix clipboard data size handling X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~22^2~9^2~170 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=6f5d18a9f5c5ce28ed3bed98365967565dfa8b94;p=gtk4.git macos: Fix clipboard data size handling We were using the allocated memory size, not the amount of data that has been written. Fixes: #5261 --- 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