Move selection bar to top when not needed.

By moving the selection bar to the top when it's not needed, we fix extraneous blank
spaces and scrollbars.

This provides fixes for:

* #9259
* #9252

and maybe #9197.

cc @ingorichter