+/*static*/ void wxTopLevelWindowCocoa::DeactivatePendingWindow()
+{
+ if(sm_cocoaDeactivateWindow)
+ sm_cocoaDeactivateWindow->wxTopLevelWindowCocoa::CocoaDelegate_windowDidResignKey();
+ sm_cocoaDeactivateWindow = NULL;
+}
+
+void wxTopLevelWindowCocoa::CocoaDelegate_windowDidBecomeKey(void)
+{
+ DeactivatePendingWindow();
+ wxLogDebug("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidBecomeKey",this);
+ wxActivateEvent event(wxEVT_ACTIVATE, TRUE, GetId());
+ event.SetEventObject(this);
+ GetEventHandler()->ProcessEvent(event);
+}
+
+void wxTopLevelWindowCocoa::CocoaDelegate_windowDidResignKey(void)
+{
+ wxLogDebug("wxTopLevelWindowCocoa=%p::CocoaDelegate_windowDidResignKey",this);
+ wxActivateEvent event(wxEVT_ACTIVATE, FALSE, GetId());
+ event.SetEventObject(this);
+ GetEventHandler()->ProcessEvent(event);
+}
+
+void wxTopLevelWindowCocoa::CocoaDelegate_windowDidBecomeMain(void)