x11: Unset pending flush flag right before notifying on task
Together with some other state. We can do this altogether on task notification, instead of lost somewhere in this function flow. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1198 (cherry picked from commit e95c365cf01837862f87dea90190b47392ee7f67)
This commit is contained in:
parent
c25011ffba
commit
83eeb3dbd2
@ -250,8 +250,6 @@ meta_x11_selection_output_stream_perform_flush (MetaX11SelectionOutputStream *st
|
|||||||
priv->data->data,
|
priv->data->data,
|
||||||
n_elements);
|
n_elements);
|
||||||
g_byte_array_remove_range (priv->data, 0, n_elements * element_size);
|
g_byte_array_remove_range (priv->data, 0, n_elements * element_size);
|
||||||
if (priv->data->len == 0)
|
|
||||||
priv->flush_requested = FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
meta_x11_selection_output_stream_notify_selection (stream);
|
meta_x11_selection_output_stream_notify_selection (stream);
|
||||||
@ -266,6 +264,10 @@ meta_x11_selection_output_stream_perform_flush (MetaX11SelectionOutputStream *st
|
|||||||
{
|
{
|
||||||
char error_str[100];
|
char error_str[100];
|
||||||
|
|
||||||
|
priv->flush_requested = FALSE;
|
||||||
|
priv->delete_pending = FALSE;
|
||||||
|
priv->pipe_error = TRUE;
|
||||||
|
|
||||||
XGetErrorText (xdisplay, error_code, error_str, sizeof (error_str));
|
XGetErrorText (xdisplay, error_code, error_str, sizeof (error_str));
|
||||||
g_task_return_new_error (priv->pending_task,
|
g_task_return_new_error (priv->pending_task,
|
||||||
G_IO_ERROR,
|
G_IO_ERROR,
|
||||||
@ -273,12 +275,12 @@ meta_x11_selection_output_stream_perform_flush (MetaX11SelectionOutputStream *st
|
|||||||
"Failed to flush selection output stream: %s",
|
"Failed to flush selection output stream: %s",
|
||||||
error_str);
|
error_str);
|
||||||
g_clear_object (&priv->pending_task);
|
g_clear_object (&priv->pending_task);
|
||||||
priv->pipe_error = TRUE;
|
|
||||||
}
|
}
|
||||||
else if (priv->pending_task)
|
else if (priv->pending_task)
|
||||||
{
|
{
|
||||||
size_t result;
|
size_t result;
|
||||||
|
|
||||||
|
priv->flush_requested = FALSE;
|
||||||
result = GPOINTER_TO_SIZE (g_task_get_task_data (priv->pending_task));
|
result = GPOINTER_TO_SIZE (g_task_get_task_data (priv->pending_task));
|
||||||
g_task_return_int (priv->pending_task, result);
|
g_task_return_int (priv->pending_task, result);
|
||||||
g_clear_object (&priv->pending_task);
|
g_clear_object (&priv->pending_task);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user