[gtk] macos: Fix clipboard data size handling



commit 6f5d18a9f5c5ce28ed3bed98365967565dfa8b94
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Oct 16 23:45:28 2022 -0400

    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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]