[PATCH] dix: Fix crash in DeliverGrabbedEvents.

Keith Packard keithp at keithp.com
Wed Apr 14 15:13:04 PDT 2010


On Wed, 14 Apr 2010 17:43:22 +1000, Peter Hutterer <peter.hutterer at who-t.net> wrote:

> The check's purpose is to compare if the other device is grabbed by the same
> client, which should be checked by accessing (dev->deviceGrab->grab->resource).
> A check of the server-1.3 sources confirms that.

This seems obvious -- when sync.state is set to FREEZE_BOTH_NEXT_EVENT,
the same device may get sync.other set to NullGrab. And, the goal is to
re-freeze any device grabbed by the same client, which is what the new
code does. I don't understand what the old code was trying to do; there
isn't any reason to talk about the sync.other element.

> @@ -3980,7 +3980,7 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev,
>  		FreezeThaw(dev, TRUE);
>  		if ((dev->deviceGrab.sync.state == FREEZE_BOTH_NEXT_EVENT) &&
>  		    (CLIENT_BITS(grab->resource) ==
> -		     CLIENT_BITS(dev->deviceGrab.sync.other->resource)))
> +		     CLIENT_BITS(dev->deviceGrab.grab->resource)))
>  		    dev->deviceGrab.sync.state = FROZEN_NO_EVENT;
>  		else
>                      dev->deviceGrab.sync.other = grab;

Reviewed-by: Keith Packard <keithp at keithp.com>

-- 
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/20100414/8dba3f2f/attachment-0001.pgp>


More information about the xorg-devel mailing list