--- a/src/ui/clipboard.cpp 2019-01-15 05:29:27.000000000 +0100 +++ b/src/ui/clipboard.cpp 2024-12-31 20:41:22.337917664 +0100 @@ -1163,7 +1163,11 @@ // FIXME: Temporary hack until we add support for memory output. // Save to a temporary file, read it back and then set the clipboard contents gchar *filename = g_build_filename( g_get_tmp_dir(), "inkscape-clipboard-export", NULL ); - gsize len; gchar *data; + gchar *data; + gsize len; + + bool previous_gui = INKSCAPE.use_gui(); + INKSCAPE.use_gui(false); try { if (out == outlist.end() && target == "image/png") @@ -1204,6 +1208,7 @@ } catch (...) { } + INKSCAPE.use_gui(previous_gui); g_unlink(filename); // delete the temporary file g_free(filename); }