diff options
author | Chase Douglas <chase.douglas@canonical.com> | 2012-02-03 16:19:08 -0800 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2012-02-08 18:04:15 +1000 |
commit | 9a260e9af83feb5c53ffd3b2da2dc3adf06240a1 (patch) | |
tree | 7e3690a0c28a5bb73e420d7f7dabe65ca239ebb8 /Xi/xiallowev.c | |
parent | 192b2c9a2ec04522655675ddfe71de5cf974cc7b (diff) |
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>
Diffstat (limited to 'Xi/xiallowev.c')
-rw-r--r-- | Xi/xiallowev.c | 46 |
1 files changed, 2 insertions, 44 deletions
diff --git a/Xi/xiallowev.c b/Xi/xiallowev.c index a4b2f5782..dab33930b 100644 --- a/Xi/xiallowev.c +++ b/Xi/xiallowev.c @@ -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; |