barriers: Increment event ID on hit box leave
We eventually want to send a new notify event on hitbox leave, which signifies the dawn of a new barrier event ID, so it's convenient if we can put the code here. Signed-off-by: Jasper St. Pierre <jstpierre@mecheye.net> Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
This commit is contained in:
parent
e3a734d081
commit
dac9e13a6c
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue