summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2012-11-26 20:37:56 -0500
committerPeter Hutterer <peter.hutterer@who-t.net>2012-12-17 15:02:40 +1000
commitdac9e13a6c874f3b99ba4cf9085ed0e63beb0871 (patch)
tree048a62b4b095ce0918324246e6e22bb0c7474445 /Xi
parente3a734d081ebda4460e6c1eb7dcdd0f7c10ba9b4 (diff)
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>
Diffstat (limited to 'Xi')
-rw-r--r--Xi/xibarriers.c14
1 files changed, 11 insertions, 3 deletions
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;