diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2013-03-01 08:26:06 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2013-07-17 14:34:43 +1000 |
commit | 34f5ca3a70e966d6fe232179a47c3dc660773ad5 (patch) | |
tree | a3e08c092d0ff78256cc1d3e876b14d9479d685c /Xi | |
parent | 3608d9f3dd6ae1d23e23294e9a56cb8158e65d19 (diff) |
Xi: use a temp variable for the new listener
Instead of accessing ti->listener[0] all the time.
No functional changes.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit fc504a44d12d537d4e07f659f1863f200a0272ad)
Diffstat (limited to 'Xi')
-rw-r--r-- | Xi/exevents.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c index d39cf89a7..77c705f7a 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -1126,20 +1126,22 @@ static void TouchPuntToNextOwner(DeviceIntPtr dev, TouchPointInfoPtr ti, TouchOwnershipEvent *ev) { + TouchListener *listener = &ti->listeners[0]; /* new owner */ + /* Deliver the ownership */ - if (ti->listeners[0].state == LISTENER_AWAITING_OWNER || - ti->listeners[0].state == LISTENER_EARLY_ACCEPT) + if (listener->state == LISTENER_AWAITING_OWNER || + listener->state == LISTENER_EARLY_ACCEPT) DeliverTouchEvents(dev, ti, (InternalEvent *) ev, - ti->listeners[0].listener); - else if (ti->listeners[0].state == LISTENER_AWAITING_BEGIN) { + listener->listener); + else if (listener->state == LISTENER_AWAITING_BEGIN) { /* We can't punt to a pointer listener unless all older pointer * emulated touches have been seen already. */ - if ((ti->listeners[0].type == LISTENER_POINTER_GRAB || - ti->listeners[0].type == LISTENER_POINTER_REGULAR) && + if ((listener->type == LISTENER_POINTER_GRAB || + listener->type == LISTENER_POINTER_REGULAR) && ti != FindOldestPointerEmulatedTouch(dev)) return; - TouchEventHistoryReplay(ti, dev, ti->listeners[0].listener); + TouchEventHistoryReplay(ti, dev, listener->listener); } /* If we've just removed the last grab and the touch has physically @@ -1150,7 +1152,7 @@ TouchPuntToNextOwner(DeviceIntPtr dev, TouchPointInfoPtr ti, return; } - if (ti->listeners[0].state == LISTENER_EARLY_ACCEPT) + if (listener->state == LISTENER_EARLY_ACCEPT) ActivateEarlyAccept(dev, ti); } |