From 4461fbfb64a707fe1261540f42a97c33aaff6ff1 Mon Sep 17 00:00:00 2001 From: Tim Kosse Date: Sun, 15 Jun 2014 22:18:12 +0000 Subject: [PATCH] Under certain conditions, selecting a menu item triggers an assert in toplevel.cpp:1544: wxASSERT_MSG( m_menuDepth > 0, wxS("No open menus?") ); The conditions to reproduce: - Windows 8.1 - An application manifest that indicates Windows 8.1 compatibility In this case, wxGetWinVersion() used to return wxWinVersion_Unknown (Without a manifest indicating 8.1 support, wxWinVersion_8 is being returned). This in turn causes the version check against Windows98 in toplevel.cpp:455 to fail, ultimately leading to the mentioned assert. See http://msdn.microsoft.com/en-us/library/windows/desktop/ms724439%28v=vs.85%29.aspx for details. This patch on the 3.x branch of wx adjusts wxGetWinVersion to return wxWinVersion_8 on 8.1 instead of wxWinVersion_Unknown if there's such a manifest. In future, a different approach needs to be chosen that does not depend the deprecated GetVersion function. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76715 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/utils.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index 33322697e7..df4ec5ffd1 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -1488,6 +1488,13 @@ wxWinVersion wxGetWinVersion() case 2: return wxWinVersion_8; + + case 3: + // For now, map to wxWinVersion_8. In case program + // does not have a manifest indicating 8.1 + // support, Windows already performs this mapping + // for us. + return wxWinVersion_8; } break; }