[PATCH 08/10] Update device state including when touch record does not exist

Peter Hutterer peter.hutterer at who-t.net
Wed Apr 18 18:30:14 PDT 2012


On Tue, Apr 17, 2012 at 04:33:27PM -0700, Chase Douglas wrote:
> If a touch is physically active, the pointer core state should reflect
> that the first button is pressed. Currently, this only occurs when there
> are active listeners of the touch sequence. By moving the device state
> updating to the beginning of touch processing we ensure it is updated
> according to the processed physical state no matter what.
> 
> Signed-off-by: Chase Douglas <chase.douglas at canonical.com>

Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

Cheers,
  Peter

> ---
>  Xi/exevents.c |    5 ++---
>  dix/touch.c   |    8 --------
>  2 files changed, 2 insertions(+), 11 deletions(-)
> 
> diff --git a/Xi/exevents.c b/Xi/exevents.c
> index d2b088c..90b7c4d 100644
> --- a/Xi/exevents.c
> +++ b/Xi/exevents.c
> @@ -1597,6 +1597,8 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev)
>      else
>          touchid = ev->device_event.touchid;
>  
> +    UpdateDeviceState(dev, &ev->device_event);
> +
>      if (type == ET_TouchBegin) {
>          ti = TouchBeginTouch(dev, ev->device_event.sourceid, touchid,
>                               emulate_pointer);
> @@ -1996,9 +1998,6 @@ DeliverTouchEvents(DeviceIntPtr dev, TouchPointInfoPtr ti,
>  
>          DeliverTouchEvent(dev, ti, ev, listener, client, win, grab, mask);
>      }
> -
> -    if (ti->emulate_pointer)
> -        UpdateDeviceState(dev, &ev->device_event);
>  }
>  
>  int
> diff --git a/dix/touch.c b/dix/touch.c
> index 9f849b7..2c7e125 100644
> --- a/dix/touch.c
> +++ b/dix/touch.c
> @@ -364,14 +364,6 @@ TouchEndTouch(DeviceIntPtr dev, TouchPointInfoPtr ti)
>  {
>      if (ti->emulate_pointer) {
>          GrabPtr grab;
> -        DeviceEvent ev;
> -
> -        memset(&ev, 0, sizeof(ev));
> -        ev.type = ET_TouchEnd;
> -        ev.detail.button = 1;
> -        ev.touchid = ti->client_id;
> -        ev.flags = TOUCH_POINTER_EMULATED | TOUCH_END;
> -        UpdateDeviceState(dev, &ev);
>  
>          if ((grab = dev->deviceGrab.grab)) {
>              if (dev->deviceGrab.fromPassiveGrab &&
> -- 
> 1.7.9.1
> 


More information about the xorg-devel mailing list