People in Slack asked me why I didn't use another mechanism to get notified when
NSWindows are shown. Here's what I was suggested and what I found:
Does not fire for all windows showing for the first time, and if it fires, if firest only once. Closing and re-showing the window will not trigger the notification again.
That works, unless the window is not becoming key but opens "just so" or behind another window. Which some panels do sometimes. It's not a problem that they show up behind other windows at times. I think it's supposed to be the way it is in certain situations. It just makes the event unreliable for my purpose.
Same for the related
NSWindowDelegate calls you can receive, namely
The dance involving
applicationWillUpdate(_:) is still the most resilient option I know. I'm open to suggestions, though!
Browse the blog archive