Don't select tab while closing with middle-click

Also fix unused warning and ignore shift right click