From 7cc5ed96fc57cc0bdac5f36650efb3a2c939f703 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Sat, 11 Apr 2020 17:13:52 +0200 Subject: [PATCH] x11: Don't invariably queue a pending delete request We don't need doing this roundtrip for non-INCR transfers. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1198 (cherry picked from commit d2c762cc66718f1b79bb476b68439d00a16fd2a2) --- src/x11/meta-x11-selection-output-stream.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/x11/meta-x11-selection-output-stream.c b/src/x11/meta-x11-selection-output-stream.c index 854b23856..9c16ac746 100644 --- a/src/x11/meta-x11-selection-output-stream.c +++ b/src/x11/meta-x11-selection-output-stream.c @@ -247,9 +247,13 @@ meta_x11_selection_output_stream_perform_flush (MetaX11SelectionOutputStream *st PropModeReplace, (guchar *) &(long) { n_elements }, 1); + priv->delete_pending = TRUE; } else { + if (priv->incr && priv->data->len > 0) + priv->delete_pending = TRUE; + XChangeProperty (xdisplay, priv->xwindow, priv->xproperty, @@ -264,7 +268,6 @@ meta_x11_selection_output_stream_perform_flush (MetaX11SelectionOutputStream *st if (first_chunk) meta_x11_selection_output_stream_notify_selection (stream); - priv->delete_pending = TRUE; g_cond_broadcast (&priv->cond); g_mutex_unlock (&priv->mutex);