Thread: Smart Contexts
View Single Post
Quote:
Originally Posted by sriggins View Post
I am sure there are notifications for application switches. There would be no reason to poll for this. Polling died with OS 9 :)
It's not polling that's the issue really (I can see how the way I phrased that may make it sound like I was talking about polling though). There are plenty of really good reasons why an OS should not be telling applications what is and isn't currently active or running. Personally, if OS X does make this easy, I'd be pretty upset about it.

Typical event-driven systems only send event information to applications once they've determined that the application should receive info about the event. They don't send out global messages to all running applications about every event that occurs because the possible overhead and stability issues would multiply exponentially as the number of running applications increases.

So any app that wants to know what's currently active would have to register with the OS somehow to say that it wants event messages that don't directly concern its own operation or interface. I'm not sure OS X offers such a channel and, frankly, if it does it really shouldn't and I sincerely hope Apple changes that.