Try to avoid duplicates being entered into the focus history.

(Although this hasn't happened yet - or, I think it hasn't - I want to
avoid any possible problems with this happening in the future).
Added relayering operations after done moving/resizing.