X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/33ac7e6f01acbac1cff0ad400d8ea7f0bfd0a62f..87df17a11b0017d31c09f767bd921abb27193bee:/src/msw/app.cpp diff --git a/src/msw/app.cpp b/src/msw/app.cpp index 3424745eaf..6277236d8e 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -86,7 +86,7 @@ #include #include -#if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) || defined(__TWIN32__)) +#if defined(__WIN95__) && !((defined(__GNUWIN32_OLD__) || defined(__TWIN32__)) && !defined(__CYGWIN10__)) #include #endif @@ -601,7 +601,9 @@ void wxApp::CleanUp() #if wxUSE_THREADS delete wxPendingEventsLocker; // If we don't do the following, we get an apparent memory leak. +#if wxUSE_VALIDATORS ((wxEvtHandler&) wxDefaultValidator).ClearEventLocker(); +#endif #endif wxClassInfo::CleanUpClasses(); @@ -955,16 +957,21 @@ bool wxApp::DoMessage() #endif // wxUSE_THREADS // Process the message - if ( !ProcessMessage((WXMSG *)&s_currentMsg) ) - { - ::TranslateMessage(&s_currentMsg); - ::DispatchMessage(&s_currentMsg); - } + DoMessage((WXMSG *)&s_currentMsg); } return TRUE; } +void wxApp::DoMessage(WXMSG *pMsg) +{ + if ( !ProcessMessage(pMsg) ) + { + ::TranslateMessage((MSG *)pMsg); + ::DispatchMessage((MSG *)pMsg); + } +} + /* * Keep trying to process messages until WM_QUIT * received. @@ -1054,17 +1061,19 @@ bool wxApp::ProcessMessage(WXMSG *wxmsg) // a translation table. wxWindow *wnd; + bool pastTopLevelWindow = FALSE; for ( wnd = wndThis; wnd; wnd = wnd->GetParent() ) { - if ( wnd->MSWTranslateMessage(wxmsg) ) + if ( !pastTopLevelWindow && wnd->MSWTranslateMessage(wxmsg)) return TRUE; - } - - // Anyone for a non-translation message? Try youngest descendants first. - for ( wnd = wndThis; wnd; wnd = wnd->GetParent() ) - { if ( wnd->MSWProcessMessage(wxmsg) ) return TRUE; + + // stop at first top level window, i.e. don't try to process the key + // strokes originating in a dialog using the accelerators of the parent + // frame - this doesn't make much sense + if ( wnd->IsTopLevel() ) + pastTopLevelWindow = TRUE; } return FALSE;