Commit 82dcb68a authored by Keith Packard's avatar Keith Packard Committed by Adam Jackson

AttendClient of grab-pervious client must queue to saved_ready_clients [v2]

A client which is attended while a grab is blocking execution of its
requests needs to be placed in the saved_ready_clients list so that it
will get scheduled once the grab terminates. Otherwise, if the client
never sends another request, there is no way for it to be placed in
the ready_clients list.

v2: Wrap comment above mark_client_saved_ready.
    Remove test for OS_COMM_IGNORED which will always be true.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99333Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
(cherry picked from commit 785053d0)
parent 14516988
......@@ -266,6 +266,16 @@ mark_client_ready(ClientPtr client)
xorg_list_append(&client->ready, &ready_clients);
}
/*
* Client has requests queued or data on the network, but awaits a
* server grab release
*/
void mark_client_saved_ready(ClientPtr client)
{
if (xorg_list_is_empty(&client->ready))
xorg_list_append(&client->ready, &saved_ready_clients);
}
/* Client has no requests queued and no data on network */
void
mark_client_not_ready(ClientPtr client)
......
......@@ -143,6 +143,12 @@ extern void SmartScheduleStopTimer(void);
/* Client has requests queued or data on the network */
void mark_client_ready(ClientPtr client);
/*
* Client has requests queued or data on the network, but awaits a
* server grab release
*/
void mark_client_saved_ready(ClientPtr client);
/* Client has no requests queued and no data on network */
void mark_client_not_ready(ClientPtr client);
......
......@@ -1067,6 +1067,10 @@ AttendClient(ClientPtr client)
set_poll_client(client);
if (listen_to_client(client))
mark_client_ready(client);
else {
/* grab active, mark ready when grab goes away */
mark_client_saved_ready(client);
}
}
/* make client impervious to grabs; assume only executing client calls this */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment