Restore selection after dock updates. Re #8032
Merge branch 'bugfix/8032_dock_loses_selection' into develop