diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2013-03-01 12:52:35 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2013-05-10 14:32:36 +1000 |
commit | e7f79c48b0faea910dc881034c00eb807fcd6210 (patch) | |
tree | 517446bcd79cf9d8dd4d90f4cebbfb16bab72e2d /dix | |
parent | 0eb9390f6048049136347d5a5834d88bfc67cc09 (diff) |
dix: move EmitTouchEnd to touch.c
No functional changes, this just enables it to be re-used easier.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'dix')
-rw-r--r-- | dix/touch.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/dix/touch.c b/dix/touch.c index 76592e72a..f7112fca9 100644 --- a/dix/touch.c +++ b/dix/touch.c @@ -1075,3 +1075,30 @@ TouchEndPhysicallyActiveTouches(DeviceIntPtr dev) FreeEventList(eventlist, GetMaximumEventsNum()); } + +/** + * Generate and deliver a TouchEnd event. + * + * @param dev The device to deliver the event for. + * @param ti The touch point record to deliver the event for. + * @param flags Internal event flags. The called does not need to provide + * TOUCH_CLIENT_ID and TOUCH_POINTER_EMULATED, this function will ensure + * they are set appropriately. + * @param resource The client resource to deliver to, or 0 for all clients. + */ +void +TouchEmitTouchEnd(DeviceIntPtr dev, TouchPointInfoPtr ti, int flags, XID resource) +{ + InternalEvent event; + + /* We're not processing a touch end for a frozen device */ + if (dev->deviceGrab.sync.frozen) + return; + + flags |= TOUCH_CLIENT_ID; + if (ti->emulate_pointer) + flags |= TOUCH_POINTER_EMULATED; + TouchDeliverDeviceClassesChangedEvent(ti, GetTimeInMillis(), resource); + GetDixTouchEnd(&event, dev, ti, flags); + DeliverTouchEvents(dev, ti, &event, resource); +} |