Fix bug in triple-click handling

Closes #1953