diff --git a/Xi/xibarriers.c b/Xi/xibarriers.c index 95a62ae32..45e97cf1d 100644 --- a/Xi/xibarriers.c +++ b/Xi/xibarriers.c @@ -418,8 +418,16 @@ input_constrain_cursor(DeviceIntPtr dev, ScreenPtr screen, xorg_list_for_each_entry(c, &cs->barriers, entry) { c->seen = FALSE; - if (c->hit && !barrier_inside_hit_box(&c->barrier, x, y)) - c->hit = FALSE; + if (!c->hit) + continue; + + if (barrier_inside_hit_box(&c->barrier, x, y)) + continue; + + c->hit = FALSE; + /* If we've left the hit box, this is the + * start of a new event ID. */ + c->barrier_event_id++; } out: @@ -486,7 +494,7 @@ CreatePointerBarrierClient(ClientPtr client, } ret->id = stuff->barrier; - ret->barrier_event_id = 0; + ret->barrier_event_id = 1; ret->release_event_id = 0; ret->hit = FALSE; ret->seen = FALSE;