Bug Description

I'll explain with an example.
I've an instance of Firefox running and an instance of Synaptic running.

If the focus is on Firefox and when I switch to Synaptic there is a modal dialog, when I close the modal dialog I'll see Synaptic but with the Firefox global menu.
I think the focus is given to the modal dialog, so when this is closed, the focus returns to the previous owner, that is Firefox in this case. Instead it should be given to the window currently on the screen (infact sometimes I close an application while I think I'm closing another one).