diff --git a/docs/changes.txt b/docs/changes.txt index f4867d6ac6..73471219dd 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -71,6 +71,10 @@ All: - Make wxList and wxVector iterators conform to input iterator requirements. +wxMSW: + +- Fix hang after clearing wxTAB_TRAVERSAL style on a window with children. + 3.1.1: (released 2018-02-19) ---------------------------- diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 0082cef587..ca8fccb9da 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -1409,7 +1409,14 @@ void wxWindowMSW::MSWUpdateStyle(long flagsOld, long exflagsOld) WS_SYSMENU) ) != 0; } - // and the extended style + // There is one extra complication with the extended style: we must never + // reset WS_EX_CONTROLPARENT because it may break the invariant that the + // parent of any window with this style bit set has it as well. We enforce + // this invariant elsewhere and must not clear it here to avoid the fatal + // problems (hangs) which happen if we break it, so ensure it is preserved. + if ( exstyleOld & WS_EX_CONTROLPARENT ) + exstyle |= WS_EX_CONTROLPARENT; + wxMSWWinExStyleUpdater updateExStyle(GetHwnd()); if ( updateExStyle.TurnOff(exstyleOld).TurnOn(exstyle).Apply() ) {