X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/383cbf1320bceeb489d96d4369b9addbf527b177..99e8cb505ad94704ec6596d20842ca8fa34e7d9e:/src/mac/carbon/toplevel.cpp diff --git a/src/mac/carbon/toplevel.cpp b/src/mac/carbon/toplevel.cpp index 7e10934096..66c28891ca 100644 --- a/src/mac/carbon/toplevel.cpp +++ b/src/mac/carbon/toplevel.cpp @@ -439,6 +439,7 @@ void wxRemoveMacWindowAssociation(wxTopLevelWindowMac *win) // ---------------------------------------------------------------------------- WXHWND wxTopLevelWindowMac::s_macWindowInUpdate = NULL; +wxTopLevelWindowMac *wxTopLevelWindowMac::s_macDeactivateWindow = NULL; void wxTopLevelWindowMac::Init() { @@ -680,7 +681,7 @@ void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title, #if TARGET_CARBON InstallStandardEventHandler( GetWindowEventTarget(MAC_WXHWND(m_macWindow)) ) ; InstallWindowEventHandler(MAC_WXHWND(m_macWindow), GetwxMacWindowEventHandlerUPP(), - GetEventTypeCount(eventList), eventList, this, &((EventHandlerRef)m_macEventHandler)); + GetEventTypeCount(eventList), eventList, this, (EventHandlerRef *)&m_macEventHandler); #endif m_macFocus = NULL ; @@ -916,8 +917,21 @@ void wxTopLevelWindowMac::MacMouseMoved( WXEVENTREF ev , short part) #endif +void wxTopLevelWindowMac::MacDelayedDeactivation(long timestamp) +{ + if(s_macDeactivateWindow) + { + wxLogDebug("Doing delayed deactivation of %p",s_macDeactivateWindow); + s_macDeactivateWindow->MacActivate(timestamp, false); + } +} + void wxTopLevelWindowMac::MacActivate( long timestamp , bool inIsActivating ) { + wxLogDebug("TopLevel=%p::MacActivate",this); + if(s_macDeactivateWindow==this) + s_macDeactivateWindow=NULL; + MacDelayedDeactivation(timestamp); wxActivateEvent event(wxEVT_ACTIVATE, inIsActivating , m_windowId); event.m_timeStamp = timestamp ; event.SetEventObject(this);