X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e6c96a7ca418179cee6b1418bd9c59be641d5456..b0cb01589f81b1794e07b82ff3d23f9757fb33d2:/src/common/tbarbase.cpp diff --git a/src/common/tbarbase.cpp b/src/common/tbarbase.cpp index 020171d8f4..e53657dea2 100644 --- a/src/common/tbarbase.cpp +++ b/src/common/tbarbase.cpp @@ -583,7 +583,8 @@ void wxToolBarBase::OnMouseEnter(int id) void wxToolBarBase::OnIdle(wxIdleEvent& event) { - DoToolbarUpdates(); + if (wxUpdateUIEvent::CanUpdate()) + DoToolbarUpdates(); event.Skip(); } @@ -591,21 +592,7 @@ void wxToolBarBase::OnIdle(wxIdleEvent& event) // Do the toolbar button updates (check for EVT_UPDATE_UI handlers) void wxToolBarBase::DoToolbarUpdates() { - wxWindow* parent = this; - while (parent->GetParent()) - parent = parent->GetParent(); - -// This kind of #ifdef is a good way to annoy people. It breaks -// apps, but only on one platform and due to a hack in officially -// platform independent code. It took me hours to fix this. RR. -// -// #ifdef __WXMSW__ -// wxWindow* focusWin = wxFindFocusDescendant(parent); -// #else - wxWindow* focusWin = (wxWindow*) NULL; -// #endif - - wxEvtHandler* evtHandler = focusWin ? focusWin->GetEventHandler() : GetEventHandler() ; + wxEvtHandler* evtHandler = GetEventHandler() ; for ( wxToolBarToolsList::Node* node = m_tools.GetFirst(); node;