diff --git a/src/common/event.cpp b/src/common/event.cpp index 382b3ab50c..fcb917dae8 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -474,6 +474,13 @@ bool wxUpdateUIEvent::CanUpdate(wxWindowBase *win) ((win->GetExtraStyle() & wxWS_EX_PROCESS_UI_UPDATES) == 0))) return false; + // Don't update children of the hidden windows: this is useless as any + // change to their state won't be seen by the user anyhow. Notice that this + // argument doesn't apply to the hidden windows (with visible parent) + // themselves as they could be shown by their EVT_UPDATE_UI handler. + if ( win->GetParent() && !win->GetParent()->IsShownOnScreen() ) + return false; + if (sm_updateInterval == -1) return false; diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 0b8a353c3a..77729d68c6 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -2651,7 +2651,7 @@ bool wxWindowBase::SendIdleEvents(wxIdleEvent& event) void wxWindowBase::OnInternalIdle() { - if (wxUpdateUIEvent::CanUpdate(this) && IsShownOnScreen()) + if ( wxUpdateUIEvent::CanUpdate(this) ) UpdateWindowUI(wxUPDATE_UI_FROMIDLE); }