[PATCH 4/3] Use WriteEventsToClient rather than TryClientEvents where possible.

Jamey Sharp jamey at minilop.net
Sat May 15 17:13:31 PDT 2010


On Sat, May 15, 2010 at 4:50 PM, Keith Packard <keithp at keithp.com> wrote:
> On Sat, 15 May 2010 16:08:14 -0700, Jamey Sharp <jamey at minilop.net> wrote:
>> OK, that makes sense, though I still think "xv: TryClientEvents already
>> checks client and sets sequenceNumber" is worth applying on its own, and
>> the below patch is only right if "Make WriteEventsToClient/WriteToClient
>> no-op" is applied first.
>
> I didn't see the patch to make WriteEventsToClient check for a
> dead/null/server client? Did I miss something? That seems like a good
> idea to me; I looked through the server and found a couple of places
> which aren't checking.

Yeah, that was patch 2/3 of this series. On further thought, we
definitely need patch 3/3 as well before this patch 4/3 is correct, or
the event sequence numbers won't get set.

>> +     if (pSel->client && pSel->client != serverClient && !pSel->client->clientGone)
>> +     {
>> +         WriteEventsToClient(pSel->client, 1, &event);
>>           return Success;
>> +     }
>
> And if WriteEventsToClient checks these things, perhaps this code
> shouldn't

In that particular case, the existing code seemed to want to only
return early if pSel->client was a real and live client. I didn't
spend a lot of thought on what the semantics were really supposed to
be; I just tried to preserve the existing behavior.

Jamey


More information about the xorg-devel mailing list