diff options
author | Christophe Fergeau <cfergeau@redhat.com> | 2014-10-28 11:39:09 +0100 |
---|---|---|
committer | Christophe Fergeau <cfergeau@redhat.com> | 2014-10-29 12:17:20 +0100 |
commit | 43e3f6ea012236b1c3759a48b24026bdeff5d7e0 (patch) | |
tree | 1f91a2496a6e30ab563c49cc50fc4433aee6a5e4 | |
parent | 9eda1556cfb1fac4cee9405bc47a8c7d4daaba40 (diff) |
Don't strip \0 from non-text clipboard data
Commit a8f2e2d added recomputation of the length of clipboard data to
strip the trailing \0 in order to avoid a Windows gtk+ bug. However it's
doing it too for non-text data, which causes issues when copying images
as they are very likely to contain \0 within their data. They will thus
be truncated.
This fixes https://bugzilla.redhat.com/show_bug.cgi?id=1154719
-rw-r--r-- | gtk/spice-gtk-session.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gtk/spice-gtk-session.c b/gtk/spice-gtk-session.c index ccbd89a..10bd762 100644 --- a/gtk/spice-gtk-session.c +++ b/gtk/spice-gtk-session.c @@ -880,9 +880,8 @@ static void clipboard_received_cb(GtkClipboard *clipboard, gpointer conv = NULL; /* gtk+ internal utf8 newline is always LF, even on windows */ - if (type == VD_AGENT_CLIPBOARD_UTF8_TEXT && - spice_main_agent_test_capability(s->main, VD_AGENT_CAP_GUEST_LINEEND_CRLF)) { - { + if (type == VD_AGENT_CLIPBOARD_UTF8_TEXT) { + if (spice_main_agent_test_capability(s->main, VD_AGENT_CAP_GUEST_LINEEND_CRLF)) { GError *err = NULL; conv = spice_unix2dos((gchar*)data, len, &err); |