diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2012-12-13 14:42:32 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2012-12-18 08:28:02 +1000 |
commit | 2eefa5d6e870c57ac6a5930883d8cfe3a3882a43 (patch) | |
tree | d7144cea449f76d58acbe4afed9d7d58fed59320 | |
parent | e2423b627ef7e4d08ea0685af5e771ddd2b511ce (diff) |
Xi: if a MD is removed, send a barrier leave event (if applicable)barriers
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
-rw-r--r-- | Xi/xibarriers.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/Xi/xibarriers.c b/Xi/xibarriers.c index 171463455..7b7b83f1c 100644 --- a/Xi/xibarriers.c +++ b/Xi/xibarriers.c @@ -714,12 +714,41 @@ static void remove_master_func(pointer res, XID id, pointer devid) struct PointerBarrierDevice *pbd; struct PointerBarrierClient *barrier; struct PointerBarrier *b; + DeviceIntPtr dev; int *deviceid = devid; + int rc; + Time ms = GetTimeInMillis(); + + rc = dixLookupDevice(&dev, *deviceid, serverClient, DixSendAccess); + if (rc != Success) + return; b = res; barrier = container_of(b, struct PointerBarrierClient, barrier); pbd = GetBarrierDevice(barrier, *deviceid); + + if (pbd->hit) { + BarrierEvent ev = { + .header = ET_Internal, + .type =ET_BarrierLeave, + .length = sizeof (BarrierEvent), + .time = ms, + .deviceid = *deviceid, + .sourceid = 0, + .dx = 0, + .dy = 0, + .root = barrier->screen->root->drawable.id, + .window = barrier->window, + .dt = ms - pbd->last_timestamp, + .flags = XIBarrierPointerReleased, + .event_id = pbd->barrier_event_id, + .barrierid = barrier->id, + }; + + mieqEnqueue(dev, (InternalEvent *) &ev); + } + xorg_list_del(&pbd->entry); free(pbd); } @@ -731,7 +760,6 @@ void XIBarrierNewMasterDevice(ClientPtr client, int deviceid) void XIBarrierRemoveMasterDevice(ClientPtr client, int deviceid) { - /* FIXME: send LeaveNotify */ FindClientResourcesByType(client, PointerBarrierType, remove_master_func, &deviceid); } |