mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-09 23:22:22 +00:00
Move AllowTouch to dix/touch.c, and rename to TouchAcceptReject
Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
192b2c9a2e
commit
9a260e9af8
3 changed files with 49 additions and 44 deletions
|
|
@ -57,47 +57,6 @@ SProcXIAllowEvents(ClientPtr client)
|
|||
return ProcXIAllowEvents(client);
|
||||
}
|
||||
|
||||
static int
|
||||
AllowTouch(ClientPtr client, DeviceIntPtr dev, int mode, uint32_t touchid, XID *error)
|
||||
{
|
||||
TouchPointInfoPtr ti;
|
||||
int nev, i;
|
||||
InternalEvent *events = InitEventList(GetMaximumEventsNum());
|
||||
|
||||
if (!events)
|
||||
return BadAlloc;
|
||||
|
||||
if (!dev->touch)
|
||||
{
|
||||
*error = dev->id;
|
||||
return BadDevice;
|
||||
}
|
||||
|
||||
/* FIXME window is unhandled */
|
||||
|
||||
ti = TouchFindByClientID(dev, touchid);
|
||||
if (!ti)
|
||||
{
|
||||
*error = touchid;
|
||||
return BadValue;
|
||||
}
|
||||
|
||||
/* FIXME: Allow for early accept */
|
||||
if (ti->num_listeners == 0 || CLIENT_ID(ti->listeners[0].listener) != client->index)
|
||||
return BadAccess;
|
||||
|
||||
nev = GetTouchOwnershipEvents(events, dev, ti, mode, ti->listeners[0].listener, 0);
|
||||
if (nev == 0)
|
||||
return BadAlloc;
|
||||
for (i = 0; i < nev; i++)
|
||||
mieqProcessDeviceEvent(dev, events + i, NULL);
|
||||
|
||||
ProcessInputEvents();
|
||||
|
||||
FreeEventList(events, GetMaximumEventsNum());
|
||||
return Success;
|
||||
}
|
||||
|
||||
int
|
||||
ProcXIAllowEvents(ClientPtr client)
|
||||
{
|
||||
|
|
@ -138,9 +97,8 @@ ProcXIAllowEvents(ClientPtr client)
|
|||
break;
|
||||
case XIRejectTouch:
|
||||
case XIAcceptTouch:
|
||||
ret = AllowTouch(client, dev,
|
||||
stuff->mode, stuff->touchid,
|
||||
&client->errorValue);
|
||||
ret = TouchAcceptReject(client, dev, stuff->mode, stuff->touchid,
|
||||
&client->errorValue);
|
||||
break;
|
||||
default:
|
||||
client->errorValue = stuff->mode;
|
||||
|
|
|
|||
Loading…
Reference in a new issue