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

Keith Packard keithp at keithp.com
Sat May 15 16:50:04 PDT 2010


On Sat, 15 May 2010 16:08:14 -0700, Jamey Sharp <jamey at minilop.net> wrote:
> If filter is NoEventMask (aka CantBeFiltered), grab is null, and the
> first event is not in the set of "critical events", then TryClientEvents
> simply calls WriteEventsToClient. In that case, it returns 0 for fake or
> dead clients, and 1 otherwise. Inline for this special case.
> 
> Signed-off-by: Jamey Sharp <jamey at minilop.net>
> ---
> On Sat, May 15, 2010 at 2:40 PM, Keith Packard <keithp at keithp.com> wrote:
> > I'd say Xv should be using WriteEventsToClient as it's not sending an
> > input event.
> 
> 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.

> +	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

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100515/efb2c9f6/attachment.pgp>


More information about the xorg-devel mailing list