1. app receives a deactivate (windowDidResignMain) for document A
2. app receives a deactivate for document B
3. app receives an activate (windowDidBecomeMain) for document A
4. app receives an activate for document B
If one then clicks on document A, one will receive the *exact* same
sequence all over again!
I can't fathom why I receive deactivate and activate notifications
for both windows, every time one window is clicked once.
I just put together a quick test app and can't reproduce your results.
I'll bet something's up with how you're registering for
notifications, maybe you're passing 'nil' for the object parameter?
If so, your notification handler will get called whenever ANY window
becomes or resigns main.