mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
x11: Ensure flush() Flushes all output stream data
This seemed to work under the assumption that a flush() call can only result in one INCR roundtrip. This is evidently not true, so we should hold things off until all pending data is actually flushed. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1198
This commit is contained in:
parent
e95c365cf0
commit
8a2b82897d
@ -288,11 +288,16 @@ meta_x11_selection_output_stream_invoke_flush (gpointer data)
|
||||
{
|
||||
MetaX11SelectionOutputStream *stream =
|
||||
META_X11_SELECTION_OUTPUT_STREAM (data);
|
||||
MetaX11SelectionOutputStreamPrivate *priv =
|
||||
meta_x11_selection_output_stream_get_instance_private (stream);
|
||||
|
||||
if (meta_x11_selection_output_stream_needs_flush (stream) &&
|
||||
meta_x11_selection_output_stream_can_flush (stream))
|
||||
meta_x11_selection_output_stream_perform_flush (stream);
|
||||
|
||||
if (priv->delete_pending || priv->data->len > 0)
|
||||
return G_SOURCE_CONTINUE;
|
||||
else
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
@ -473,10 +478,9 @@ meta_x11_selection_output_stream_flush_async (GOutputStream *output_stream
|
||||
}
|
||||
}
|
||||
|
||||
g_assert (priv->pending_task == NULL);
|
||||
priv->pending_task = task;
|
||||
meta_x11_selection_output_stream_perform_flush (stream);
|
||||
g_task_return_boolean (task, TRUE);
|
||||
g_object_unref (task);
|
||||
return;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
Loading…
Reference in New Issue
Block a user