From 958dd805c2c6d32293671ba96d438c193be723ab Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 25 Oct 2013 12:17:38 +0000 Subject: [PATCH] Restore the check for wxTAB_TRAVERSAL in wxMSW wxWindow code. This check was replaced with a check for WS_EX_CONTROLPARENT in r74732 to avoid using ::IsDialogMessage() when WS_EX_CONTROLPARENT is not set, but it also resulted in using it when WS_EX_CONTROLPARENT is set but wxTAB_TRAVERSAL is not. Check for both of them now so that we only use IsDialogMessage() when we need it (wxTAB_TRAVERSAL) and when it is safe to do it (WS_EX_CONTROLPARENT). Closes #15565. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75061 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/window.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 479efcfc90..1f0f700a68 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -2303,12 +2303,14 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg) { // wxUniversal implements tab traversal itself #ifndef __WXUNIVERSAL__ - // Notice that we check for WS_EX_CONTROLPARENT and not wxTAB_TRAVERSAL - // here. While usually they are both set or both unset, doing it like this - // also works if there is ever a bug that results in wxTAB_TRAVERSAL being - // set but not WS_EX_CONTROLPARENT as we must not call IsDialogMessage() in - // this case, it would simply hang (see #15458). - if ( m_hWnd != 0 && (wxGetWindowExStyle(this) & WS_EX_CONTROLPARENT) ) + // Notice that we check for both wxTAB_TRAVERSAL and WS_EX_CONTROLPARENT + // being set here. While normally the latter should always be set if the + // former is, doing it like this also works if there is ever a bug that + // results in wxTAB_TRAVERSAL being set but not WS_EX_CONTROLPARENT as we + // must not call IsDialogMessage() then, it would simply hang (see #15458). + if ( m_hWnd && + HasFlag(wxTAB_TRAVERSAL) && + (wxGetWindowExStyle(this) & WS_EX_CONTROLPARENT) ) { // intercept dialog navigation keys MSG *msg = (MSG *)pMsg;