From 168bab34f747b87250ead85838d90cee3931f02d Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 18 Aug 2024 14:23:36 -0400 Subject: [PATCH] inspector: Simplify We can just put the render node on the clipboard directly, no manual serialization required. --- gtk/inspector/recorder.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/gtk/inspector/recorder.c b/gtk/inspector/recorder.c index 2a6c595dcb..0d160c42a1 100644 --- a/gtk/inspector/recorder.c +++ b/gtk/inspector/recorder.c @@ -2033,22 +2033,13 @@ render_node_clip (GtkButton *button, { GskRenderNode *node; GdkClipboard *clipboard; - GBytes *bytes; - GdkContentProvider *content; node = get_selected_node (recorder); if (node == NULL) return; - bytes = gsk_render_node_serialize (node); - content = gdk_content_provider_new_for_bytes ("text/plain;charset=utf-8", bytes); - clipboard = gtk_widget_get_clipboard (GTK_WIDGET (recorder)); - - gdk_clipboard_set_content (clipboard, content); - - g_object_unref (content); - g_bytes_unref (bytes); + gdk_clipboard_set (clipboard, GSK_TYPE_RENDER_NODE, node); } static void