diff --git a/Limelight/Input/StreamView.m b/Limelight/Input/StreamView.m index bd4afa2..1011543 100644 --- a/Limelight/Input/StreamView.m +++ b/Limelight/Input/StreamView.m @@ -139,6 +139,20 @@ 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; + } } }