Added wxWakeUpIdle() for MSW and empty stubs for Motif, OS2, and Mac
Pending events are now deleted after being processed git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -310,10 +310,8 @@ extern void WXDLLEXPORT wxExit();
|
||||
// Yield to other apps/messages
|
||||
extern bool WXDLLEXPORT wxYield();
|
||||
|
||||
#ifdef __WXGTK__
|
||||
// Yield to other apps/messages
|
||||
extern void WXDLLEXPORT wxWakeUpIdle();
|
||||
#endif
|
||||
|
||||
// Post a message to the given eventhandler which will be processed during the
|
||||
// next event loop iteration
|
||||
|
@@ -609,15 +609,7 @@ void wxEvtHandler::AddPendingEvent(wxEvent& event)
|
||||
|
||||
wxLEAVE_CRIT_SECT(wxPendingEventsLocker);
|
||||
|
||||
// TODO: Wake up idle handler for the other platforms.
|
||||
#ifdef __WXGTK__
|
||||
wxWakeUpIdle();
|
||||
#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;
|
||||
wxTheApp->OnIdle(eventIdle);
|
||||
#endif // platform
|
||||
}
|
||||
|
||||
void wxEvtHandler::ProcessPendingEvents()
|
||||
@@ -631,6 +623,7 @@ void wxEvtHandler::ProcessPendingEvents()
|
||||
{
|
||||
event = (wxEvent *)node->Data();
|
||||
ProcessEvent(*event);
|
||||
delete event;
|
||||
delete node;
|
||||
node = m_pendingEvents->First();
|
||||
}
|
||||
|
@@ -656,6 +656,12 @@ void wxApp::OnIdle(wxIdleEvent& event)
|
||||
inOnIdle = FALSE;
|
||||
}
|
||||
|
||||
void wxWakeUpIdle()
|
||||
{
|
||||
// **** please implement me! ****
|
||||
// Wake up the idle handler processor, even if it is in another thread...
|
||||
}
|
||||
|
||||
// Send idle event to all top-level windows
|
||||
bool wxApp::SendIdleEvents()
|
||||
{
|
||||
|
@@ -656,6 +656,12 @@ void wxApp::OnIdle(wxIdleEvent& event)
|
||||
inOnIdle = FALSE;
|
||||
}
|
||||
|
||||
void wxWakeUpIdle()
|
||||
{
|
||||
// **** please implement me! ****
|
||||
// Wake up the idle handler processor, even if it is in another thread...
|
||||
}
|
||||
|
||||
// Send idle event to all top-level windows
|
||||
bool wxApp::SendIdleEvents()
|
||||
{
|
||||
|
@@ -483,6 +483,13 @@ void wxApp::OnIdle(wxIdleEvent& event)
|
||||
inOnIdle = FALSE;
|
||||
}
|
||||
|
||||
void wxWakeUpIdle()
|
||||
{
|
||||
// **** please implement me! ****
|
||||
// Wake up the idle handler processor, even if it is in another thread...
|
||||
}
|
||||
|
||||
|
||||
// Send idle event to all top-level windows
|
||||
bool wxApp::SendIdleEvents()
|
||||
{
|
||||
|
@@ -1168,6 +1168,24 @@ bool wxYield()
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxWakeUpIdle
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void wxWakeUpIdle()
|
||||
{
|
||||
// Send the top window a dummy message so idle handler processing will
|
||||
// start up again. Doing it this way ensures that the idle handler
|
||||
// wakes up in the right thread.
|
||||
wxWindow *topWindow = wxTheApp->GetTopWindow();
|
||||
if ( topWindow ) {
|
||||
HWND hWnd = (HWND)topWindow->GetHWND();
|
||||
::PostMessage(hWnd, WM_NULL, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
wxIcon
|
||||
wxApp::GetStdIcon(int which) const
|
||||
{
|
||||
|
@@ -767,6 +767,12 @@ void wxApp::OnIdle(
|
||||
sbInOnIdle = FALSE;
|
||||
}
|
||||
|
||||
void wxWakeUpIdle()
|
||||
{
|
||||
// **** please implement me! ****
|
||||
// Wake up the idle handler processor, even if it is in another thread...
|
||||
}
|
||||
|
||||
// Send idle event to all top-level windows
|
||||
bool wxApp::SendIdleEvents()
|
||||
{
|
||||
|
Reference in New Issue
Block a user