Skip to content

Commit

Permalink
Fix mouse cursor jumping on right click gesture where only the 2nd fi…
Browse files Browse the repository at this point in the history
…nger is lifted to complete the gesture
  • Loading branch information
cgutman committed Sep 11, 2017
1 parent 89d8bc6 commit 45dbd46
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Limelight/Input/StreamView.m
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,20 @@ - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
isDragging = false;
LiSendMouseButtonEvent(BUTTON_ACTION_RELEASE, BUTTON_LEFT);
}

// We we're moving from 2+ touches to 1. Synchronize the current position
// of the active finger so we don't jump unexpectedly on the next touchesMoved
// callback when finger 1 switches on us.
if ([[event allTouches] count] - [touches count] == 1) {
NSMutableSet *activeSet = [[NSMutableSet alloc] initWithCapacity:[[event allTouches] count]];
[activeSet unionSet:[event allTouches]];
[activeSet minusSet:touches];
touchLocation = [[activeSet anyObject] locationInView:self];

// Mark this touch as moved so we don't send a left mouse click if the user
// right clicks without moving their other finger.
touchMoved = true;
}
}
}

Expand Down

0 comments on commit 45dbd46

Please sign in to comment.