There is an attached patch for #7461. When a user switches to a new connection in the query tool and closes the query tool, then the new connection is not closed.
The new connection shows as idle in Dashboard. I have fixed this in the attached patch.
Additionally, I have fixed the 'Show activity?' issue, which was overlooked during the initial porting.