[mutter/wip/carlosg/incr-is-fubar: 9/11] x11: Don't invariably queue a pending request



commit 8f489ec863a3be060a3f8c031ab21b00c268d4de
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Apr 11 17:13:52 2020 +0200

    x11: Don't invariably queue a pending request
    
    We don't need doing this roundtrip for non-INCR transfers.
    
    https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1198

 src/x11/meta-x11-selection-output-stream.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/src/x11/meta-x11-selection-output-stream.c b/src/x11/meta-x11-selection-output-stream.c
index 7423dfa7d..42abd99c1 100644
--- a/src/x11/meta-x11-selection-output-stream.c
+++ b/src/x11/meta-x11-selection-output-stream.c
@@ -239,15 +239,18 @@ meta_x11_selection_output_stream_perform_flush (MetaX11SelectionOutputStream *st
                        PropModeReplace,
                        (guchar *) &(long) { n_elements },
                        1);
+      priv->delete_pending = TRUE;
     }
   else
     {
       if (priv->data->len == 0)
         {
           priv->closing = FALSE;
+          priv->delete_pending = FALSE;
         }
       else if (priv->incr)
         {
+          priv->delete_pending = TRUE;
           if (priv->data->len < max_size)
             priv->closing = TRUE;
         }
@@ -266,7 +269,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);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]