mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 01:20:42 -05:00
x11: Only send SelectionNotify on first INCR chunk
This should only be sent if the selection can be sent at once, or
if we are right about to notify on the first chunk of an INCR
transfer.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1198
(cherry picked from commit 7c939d78c2
)
This commit is contained in:
parent
51b65b98f5
commit
622e8c348f
@ -199,6 +199,7 @@ meta_x11_selection_output_stream_perform_flush (MetaX11SelectionOutputStream *st
|
|||||||
meta_x11_selection_output_stream_get_instance_private (stream);
|
meta_x11_selection_output_stream_get_instance_private (stream);
|
||||||
Display *xdisplay;
|
Display *xdisplay;
|
||||||
size_t element_size, n_elements;
|
size_t element_size, n_elements;
|
||||||
|
gboolean first_chunk = FALSE;
|
||||||
int error_code;
|
int error_code;
|
||||||
|
|
||||||
g_assert (!priv->delete_pending);
|
g_assert (!priv->delete_pending);
|
||||||
@ -213,6 +214,9 @@ meta_x11_selection_output_stream_perform_flush (MetaX11SelectionOutputStream *st
|
|||||||
element_size = get_element_size (priv->format);
|
element_size = get_element_size (priv->format);
|
||||||
n_elements = priv->data->len / element_size;
|
n_elements = priv->data->len / element_size;
|
||||||
|
|
||||||
|
if (!priv->incr)
|
||||||
|
first_chunk = TRUE;
|
||||||
|
|
||||||
if (!g_output_stream_is_closing (G_OUTPUT_STREAM (stream)))
|
if (!g_output_stream_is_closing (G_OUTPUT_STREAM (stream)))
|
||||||
{
|
{
|
||||||
XWindowAttributes attrs;
|
XWindowAttributes attrs;
|
||||||
@ -248,7 +252,8 @@ meta_x11_selection_output_stream_perform_flush (MetaX11SelectionOutputStream *st
|
|||||||
g_byte_array_remove_range (priv->data, 0, n_elements * element_size);
|
g_byte_array_remove_range (priv->data, 0, n_elements * element_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
meta_x11_selection_output_stream_notify_selection (stream);
|
if (first_chunk)
|
||||||
|
meta_x11_selection_output_stream_notify_selection (stream);
|
||||||
|
|
||||||
priv->delete_pending = TRUE;
|
priv->delete_pending = TRUE;
|
||||||
g_cond_broadcast (&priv->cond);
|
g_cond_broadcast (&priv->cond);
|
||||||
|
Loading…
Reference in New Issue
Block a user