I am developing a Cocoa application that displays a list of open windows and highlights the current focus. My problem is that I cannot find a system notification to inform my application that the main (aka "focused" or "front") window has changed. I tried:
[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector:@selector(wsNotificationHook:) name:NSWorkspaceDidActivateApplicationNotification object:nil];
but it tracks the APPLICATION change: it does not start when the INSIDE window of the same application is modified (for example, if I pass between two Firefox windows using exposรจ). Is there a system event that I can track to track the change in the main window?
Thank you in advance!
source share