diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-12-14 13:51:12 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-12-19 09:08:32 +1000 |
commit | 93c2a1628a9f6e7480d834bf55c080997fd18911 (patch) | |
tree | 87564347d84228e3160d44735078d690fb51bb79 /dix | |
parent | 3390d3fc0347947796aa245d70fefecf59b7bfe4 (diff) |
Hook up the ownership events
This patch applies most of the protocol conversions and the internal event
type for ownership events.
Note that ownership events are generated by the DIX only, they do not pass
through the event queue.
Co-authored-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Diffstat (limited to 'dix')
-rw-r--r-- | dix/eventconvert.c | 27 | ||||
-rw-r--r-- | dix/events.c | 7 |
2 files changed, 34 insertions, 0 deletions
diff --git a/dix/eventconvert.c b/dix/eventconvert.c index 582769ad8..017c87190 100644 --- a/dix/eventconvert.c +++ b/dix/eventconvert.c @@ -58,6 +58,7 @@ static int eventToKeyButtonPointer(DeviceEvent *ev, xEvent **xi, int *count); static int eventToDeviceChanged(DeviceChangedEvent *ev, xEvent **dcce); static int eventToDeviceEvent(DeviceEvent *ev, xEvent **xi); static int eventToRawEvent(RawDeviceEvent *ev, xEvent **xi); +static int eventToTouchOwnershipEvent(TouchOwnershipEvent *ev, xEvent **xi); /* Do not use, read comments below */ BOOL EventIsKeyRepeat(xEvent *event); @@ -164,6 +165,7 @@ EventToCore(InternalEvent *event, xEvent **core_out, int *count_out) case ET_TouchBegin: case ET_TouchUpdate: case ET_TouchEnd: + case ET_TouchOwnership: ret = BadMatch; break; default: @@ -220,6 +222,7 @@ EventToXI(InternalEvent *ev, xEvent **xi, int *count) case ET_TouchBegin: case ET_TouchUpdate: case ET_TouchEnd: + case ET_TouchOwnership: *count = 0; *xi = NULL; return BadMatch; @@ -265,6 +268,8 @@ EventToXI2(InternalEvent *ev, xEvent **xi) case ET_TouchUpdate: case ET_TouchEnd: return eventToDeviceEvent(&ev->device_event, xi); + case ET_TouchOwnership: + return eventToTouchOwnershipEvent(&ev->touch_ownership_event, xi); case ET_ProximityIn: case ET_ProximityOut: *xi = NULL; @@ -722,6 +727,27 @@ eventToDeviceEvent(DeviceEvent *ev, xEvent **xi) } static int +eventToTouchOwnershipEvent(TouchOwnershipEvent *ev, xEvent **xi) +{ + int len = sizeof(xXITouchOwnershipEvent); + xXITouchOwnershipEvent *xtoe; + + *xi = calloc(1, len); + xtoe = (xXITouchOwnershipEvent*)*xi; + xtoe->type = GenericEvent; + xtoe->extension = IReqCode; + xtoe->length = bytes_to_int32(len - sizeof(xEvent)); + xtoe->evtype = GetXI2Type(ev->type); + xtoe->deviceid = ev->deviceid; + xtoe->time = ev->time; + xtoe->sourceid = ev->sourceid; + xtoe->touchid = ev->touchid; + xtoe->flags = 0; /* we don't have wire flags for ownership yet */ + + return Success; +} + +static int eventToRawEvent(RawDeviceEvent *ev, xEvent **xi) { xXIRawEvent* raw; @@ -844,6 +870,7 @@ GetXI2Type(enum EventType type) case ET_TouchBegin: xi2type = XI_TouchBegin; break; case ET_TouchEnd: xi2type = XI_TouchEnd; break; case ET_TouchUpdate: xi2type = XI_TouchUpdate; break; + case ET_TouchOwnership: xi2type = XI_TouchOwnership; break; default: break; } diff --git a/dix/events.c b/dix/events.c index f80b8fddf..f8ea94f8e 100644 --- a/dix/events.c +++ b/dix/events.c @@ -2476,6 +2476,13 @@ FixUpEventFromWindow( event->root = RootWindow(pSprite)->drawable.id; event->event = pWin->drawable.id; + + if (evtype == XI_TouchOwnership) + { + event->child = child; + return; + } + if (pSprite->hot.pScreen == pWin->drawable.pScreen) { event->event_x = event->root_x - FP1616(pWin->drawable.x, 0); |