summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2018-02-07 18:30:18 +0100
committerCarlos Garnacho <carlosg@gnome.org>2018-02-08 16:29:18 +0100
commit08f60dbcf6eae0549eb7d3715582f46361a02800 (patch)
treeb1b3c975627e4f1d482735f213b85b6aca792fb1
parent63f534f4b38f1752c216ee04a16741a8b325658c (diff)
downloadgtk+-wip/carlosg/fix-issue-1.tar.gz
wayland: Improve EOF detection when reading selectionswip/carlosg/fix-issue-1
g_input_stream_read_bytes() roughly provides the same guarantees than g_input_stream_read() wrt the number of bytes being possibly read (i.e. it being a best effort, but no real guarantees). Instead, rely on the 0-len read that we'd get at the end of the transfer. Fixes clipboard/DnD transfers possibly being cut short, resulting on "Broken pipe" errors on the other side. https://gitlab.gnome.org/GNOME/gtk/issues/1 Closes: #1
-rw-r--r--gdk/wayland/gdkselection-wayland.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdk/wayland/gdkselection-wayland.c b/gdk/wayland/gdkselection-wayland.c
index 008778292a..12737d672e 100644
--- a/gdk/wayland/gdkselection-wayland.c
+++ b/gdk/wayland/gdkselection-wayland.c
@@ -245,7 +245,7 @@ selection_buffer_read_cb (GObject *object,
if (bytes)
{
- finished = g_bytes_get_size (bytes) < get_buffer_size ();
+ finished = g_bytes_get_size (bytes) == 0;
selection_buffer_append_data (buffer,
g_bytes_get_data (bytes, NULL),
g_bytes_get_size (bytes));