wxX11:
INtroduced OnInternalIdle as per wxGTK so that users cannot as easily lill the internals. Fixed pop-up transient window. Removed some #if 0 here and there. Made refresh code work in idle instead of directly. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14176 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -446,12 +446,9 @@ void wxApp::ProcessXEvent(WXEvent* _event)
|
||||
{
|
||||
if (win)
|
||||
{
|
||||
// Schedule update for later
|
||||
win->GetUpdateRegion().Union( event->xexpose.x, event->xexpose.y,
|
||||
event->xexpose.width, event->xexpose.height);
|
||||
if (event->xexpose.count == 0)
|
||||
{
|
||||
win->X11SendPaintEvents(); // TODO let an idle handler do that
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -547,41 +544,28 @@ void wxApp::HandlePropertyChange(WXEvent *event)
|
||||
|
||||
void wxApp::OnIdle(wxIdleEvent& event)
|
||||
{
|
||||
static bool inOnIdle = FALSE;
|
||||
static bool s_inOnIdle = FALSE;
|
||||
|
||||
// Avoid recursion (via ProcessEvent default case)
|
||||
if (inOnIdle)
|
||||
if (s_inOnIdle)
|
||||
return;
|
||||
|
||||
inOnIdle = TRUE;
|
||||
s_inOnIdle = TRUE;
|
||||
|
||||
// If there are pending events, we must process them: pending events
|
||||
// are either events to the threads other than main or events posted
|
||||
// with wxPostEvent() functions
|
||||
// GRG: I have moved this here so that all pending events are processed
|
||||
// before starting to delete any objects. This behaves better (in
|
||||
// particular, wrt wxPostEvent) and is coherent with wxGTK's current
|
||||
// behaviour. Also removed the '#if wxUSE_THREADS' around it.
|
||||
// Changed Mar/2000 before 2.1.14
|
||||
|
||||
// Flush pending events.
|
||||
// Resend in the main thread events which have been prepared in other
|
||||
// threads
|
||||
ProcessPendingEvents();
|
||||
|
||||
// 'Garbage' collection of windows deleted with Close().
|
||||
// 'Garbage' collection of windows deleted with Close()
|
||||
DeletePendingObjects();
|
||||
|
||||
// flush the logged messages if any
|
||||
wxLog *pLog = wxLog::GetActiveTarget();
|
||||
if ( pLog != NULL && pLog->HasPendingMessages() )
|
||||
pLog->Flush();
|
||||
|
||||
// Send OnIdle events to all windows
|
||||
bool needMore = SendIdleEvents();
|
||||
|
||||
if (needMore)
|
||||
event.RequestMore(TRUE);
|
||||
|
||||
inOnIdle = FALSE;
|
||||
s_inOnIdle = FALSE;
|
||||
}
|
||||
|
||||
void wxWakeUpIdle()
|
||||
@@ -615,7 +599,10 @@ bool wxApp::SendIdleEvents(wxWindow* win)
|
||||
|
||||
wxIdleEvent event;
|
||||
event.SetEventObject(win);
|
||||
win->ProcessEvent(event);
|
||||
|
||||
win->GetEventHandler()->ProcessEvent(event);
|
||||
|
||||
win->OnInternalIdle();
|
||||
|
||||
if (event.MoreRequested())
|
||||
needMore = TRUE;
|
||||
@@ -629,7 +616,8 @@ bool wxApp::SendIdleEvents(wxWindow* win)
|
||||
|
||||
node = node->Next();
|
||||
}
|
||||
return needMore ;
|
||||
|
||||
return needMore;
|
||||
}
|
||||
|
||||
void wxApp::DeletePendingObjects()
|
||||
|
Reference in New Issue
Block a user