ensure deleting of empty layout items
fix focus issues on windows