Pass focus to transient parent on close
When a modal dialog is closed we want to focus the parent. It happened to work because often the parent is active at the time the modal dialog is created and therefore happens to be the next thing in the stacking order.
We shouldn't be relying on that, some apps can open with a modal dialog already set.