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>
This commit is contained in:
Peter Hutterer
2013-03-01 12:52:35 +10:00
parent 0eb9390f60
commit e7f79c48b0
3 changed files with 32 additions and 31 deletions

View File

@@ -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);
}