The change made by Eric in r31206 to call [NSApp deactivate] when a WM_ACTIVEAPP message is received reporting that the app lost focus causes trouble. I'll describe what I know about the issue.
In our application, if we have two editor windows open (call them A and B) and minimize the one that has focus (say, B) then Windows apparently sends this message even though the focus switches to window A (within the same instance of the app). Window A then becomes the key window, but when we restore window B by clicking on its tile in the task bar, it now becomes the key window but leaves window A in a broken state such that after clicking in window A you can make text selections there, but all keystrokes in window A are now sent to window B!! Closing window A and reopening that document is the only way to restore it to normal functioning.
I added an NSLog at the point where the new code calls [NSApp deactivate] and found that it was called more than 20 times when I minimized a window. A comment I read online suggests that WM_ACTIVEAPP is sent for every window in the application. Perhaps that includes offscreen windows, because I only had 3 or 4 windows open at the time. Since these messages are also being sent on minimizing a window even when the app remains the active app it seems like this isn't really working the way it should.