X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8e193f384f7b98daef459653ddb8485173fba8ba..07cf98cb8eb7625eeffc95e407a9fa1ad863b451:/src/common/event.cpp?ds=sidebyside diff --git a/src/common/event.cpp b/src/common/event.cpp index 5ab57ddde6..1b71ae0912 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -321,7 +321,7 @@ bool wxMouseEvent::Button(int but) const { switch (but) { case -1: - return (ButtonUp(-1) || ButtonDown(-1) || ButtonDClick(-1)) ; + return (ButtonUp(-1) || ButtonDown(-1) || ButtonDClick(-1)); case 1: return (LeftDown() || LeftUp() || LeftDClick()); case 2: @@ -601,11 +601,13 @@ void wxEvtHandler::AddPendingEvent(wxEvent& event) m_pendingEvents->Append(event2); - wxPendingEventsLocker->Enter(); + wxENTER_CRIT_SECT(wxPendingEventsLocker); + if ( !wxPendingEvents ) wxPendingEvents = new wxList; wxPendingEvents->Append(this); - wxPendingEventsLocker->Leave(); + + wxLEAVE_CRIT_SECT(wxPendingEventsLocker); // TODO: Wake up idle handler for the other platforms. #ifdef __WXGTK__ @@ -613,7 +615,7 @@ void wxEvtHandler::AddPendingEvent(wxEvent& event) extern void wxapp_install_idle_handler(); if ( g_isIdle ) wxapp_install_idle_handler(); -#else // this works for wxMSW, but may be for others too? +#elif wxUSE_GUI // this works for wxMSW, but may be for others too? // might also send a dummy message to the top level window, this would // probably be cleaner? wxIdleEvent eventIdle; @@ -623,9 +625,7 @@ void wxEvtHandler::AddPendingEvent(wxEvent& event) void wxEvtHandler::ProcessPendingEvents() { -#if wxUSE_THREADS - wxCriticalSectionLocker locker(*m_eventsLocker); -#endif + wxCRIT_SECT_LOCKER(locker, m_eventsLocker); wxNode *node = m_pendingEvents->First(); wxEvent *event;