Remember last window focused per desktop and refocus it


Currently if you switch from desk A to desk B, and on desk A you were typing in notepad, switching to desk B, if you start typing there, notepad still is in focus.
If when switching it remembered the focused window and when returning refocused it, this would work better. I use a lot of text editors and it happens to me all the time, I end up typing things in the previous desktop.