summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2013-03-05 10:14:29 +1000
committerKeith Packard <keithp@keithp.com>2013-03-04 21:10:22 -0800
commitdd4ab8b572956f9457616869d6e383c8ed964c73 (patch)
tree38f887ecef0fa7fba6f916ed0b9ef74479d678a2 /Xi
parent604169af8b67afc74a292cdb9070a3a1f2d7c536 (diff)
Xi: force dtime to 0 on the first BarrierHit
dtime to the previous event is 0 on the first BarrierHit event. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'Xi')
-rw-r--r--Xi/xibarriers.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Xi/xibarriers.c b/Xi/xibarriers.c
index a225cbc25..fccab8615 100644
--- a/Xi/xibarriers.c
+++ b/Xi/xibarriers.c
@@ -435,6 +435,7 @@ input_constrain_cursor(DeviceIntPtr dev, ScreenPtr screen,
dir = barrier_get_direction(current_x, current_y, x, y);
while (dir != 0) {
+ int new_sequence;
struct PointerBarrierDevice *pbd;
c = barrier_find_nearest(cs, master, dir, current_x, current_y, x, y);
@@ -444,6 +445,8 @@ input_constrain_cursor(DeviceIntPtr dev, ScreenPtr screen,
nearest = &c->barrier;
pbd = GetBarrierDevice(c, master->id);
+ new_sequence = !pbd->hit;
+
pbd->seen = TRUE;
pbd->hit = TRUE;
@@ -466,7 +469,7 @@ input_constrain_cursor(DeviceIntPtr dev, ScreenPtr screen,
ev.event_id = pbd->barrier_event_id;
ev.barrierid = c->id;
- ev.dt = ms - pbd->last_timestamp;
+ ev.dt = new_sequence ? 0 : ms - pbd->last_timestamp;
ev.window = c->window;
pbd->last_timestamp = ms;