Merge lp:~dandrader/grail/lp963379 into lp:grail

Proposed by Daniel d'Andrada
Status: Merged
Merged at revision: 211
Proposed branch: lp:~dandrader/grail/lp963379
Merge into: lp:grail
Diff against target: 22 lines (+3/-3)
1 file modified
src/v3/atomic-recognizer.cpp (+3/-3)
To merge this branch: bzr merge lp:~dandrader/grail/lp963379
Reviewer Review Type Date Requested Status
Chase Douglas (community) Approve
Review via email: mp+99100@code.launchpad.net

Description of the change

If a frame event contains a touch whose start time is bigger than the event time, the atomic gestures recognizer will prematurely accept a pending gesture.

Make AtomicRecognizer::FindGestureToAccept handle negative time deltas.

A test for this minor bug would be too time consuming to be worthwhile.

To post a comment you must log in.
Revision history for this message
Chase Douglas (chasedouglas) wrote :

The boolean && operator should be at the end of the previous line instead of the beginning of the next line.

Otherwise, looks good :).

review: Approve
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

> The boolean && operator should be at the end of the previous line instead of
> the beginning of the next line.
>
> Otherwise, looks good :).

I did that on purpose, to emphasize the relationship between "delta_time > 0" and "(uint64_t)delta_time >= COMPOSITION_TIME"

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/v3/atomic-recognizer.cpp'
2--- src/v3/atomic-recognizer.cpp 2012-03-23 14:55:01 +0000
3+++ src/v3/atomic-recognizer.cpp 2012-03-23 19:23:18 +0000
4@@ -282,7 +282,7 @@
5
6 void AtomicRecognizer::FindGestureToAccept(uint64_t event_time)
7 {
8- uint64_t delta_time;
9+ int64_t delta_time;
10 for (auto it = unaccepted_gestures_.begin();
11 it != unaccepted_gestures_.end();
12 ) {
13@@ -302,8 +302,8 @@
14 4-touches' gesture and not the intermediates 2-touches and 3-touches
15 gestures.
16 */
17- if (gesture->IsActive() && delta_time > 0
18- && delta_time >= COMPOSITION_TIME) {
19+ if (gesture->IsActive()
20+ && delta_time > 0 && (uint64_t)delta_time >= COMPOSITION_TIME) {
21
22 gesture->set_keep_slices(false);
23

Subscribers

People subscribed via source and target branches