Fix bug in opening viewer in the middle click