[PATCH 2/2] Keep virtual core pointer touch class around if new slave doesn't have one
Peter Hutterer
peter.hutterer at who-t.net
Tue Feb 14 04:16:35 PST 2012
On Mon, Feb 13, 2012 at 04:00:48PM -0800, Chase Douglas wrote:
> The VCP may have active touch grabs. The touch records must be kept so
> these touch grabs may be accepted/rejected in the future. This means the
> touch class list will not represent the touch class of the attached
> slave device if it does not have a touch class, but we already were
> breaking that assumption by keeping a separate touches array for the
> VCP.
>
> Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
> ---
> I haven't seen this cause a crash in the wild, and I haven't stress tested it,
> but I don't see how accept/reject could work after we switch to a non-touch
> slave device without this change.
yeah, unfortunately that explanation makes sense. merged, thank you.
Cheers,
Peter
> Xi/exevents.c | 9 +++------
> 1 files changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/Xi/exevents.c b/Xi/exevents.c
> index 51f991c..069a52c 100644
> --- a/Xi/exevents.c
> +++ b/Xi/exevents.c
> @@ -699,13 +699,10 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to)
> to->touch->touches = to_touches_array_tmp;
> to->touch->num_touches = to_num_touches_tmp;
> to->touch->sourceid = from->id;
> - } else if (to->touch)
> - {
> - ClassesPtr classes;
> - classes = to->unused_classes;
> - classes->touch = to->touch;
> - to->touch = NULL;
> }
> + /* Don't remove touch class if from->touch is non-existent. The to device
> + * may have an active touch grab, so we need to keep the touch class record
> + * around. */
> }
>
> /**
> --
> 1.7.9
>
More information about the xorg-devel
mailing list