diff --git a/src/wayland/meta-xwayland-selection.c b/src/wayland/meta-xwayland-selection.c index 24b8cd2c1..8201b014f 100644 --- a/src/wayland/meta-xwayland-selection.c +++ b/src/wayland/meta-xwayland-selection.c @@ -689,9 +689,8 @@ wayland_data_read_cb (GObject *object, GError *error = NULL; gsize bytes_read; - bytes_read = g_input_stream_read_finish (G_INPUT_STREAM (object), - res, &error); - if (error) + if (!g_input_stream_read_all_finish (G_INPUT_STREAM (object), + res, &bytes_read, &error)) { if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { @@ -762,10 +761,10 @@ wayland_selection_data_read (MetaSelectionBridge *selection) { WaylandSelectionData *data = selection->wayland_selection; - g_input_stream_read_async (data->stream, data->buffer, - INCR_CHUNK_SIZE, G_PRIORITY_DEFAULT, - data->cancellable, - wayland_data_read_cb, selection); + g_input_stream_read_all_async (data->stream, data->buffer, + INCR_CHUNK_SIZE, G_PRIORITY_DEFAULT, + data->cancellable, + wayland_data_read_cb, selection); } static void