Avoid crashes when creating initially hidden MDI child under Unity.

Ignore "hide" signals for the menus without associated shown window. Ubuntu
Unity sends them and we crashed because of a recursive assert in the
corresponding signal handler before.

Now the code doesn't crash any more but the menus still don't behave correctly
when the last MDI child is destroyed.

Closes #13593.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72379 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-08-26 16:35:02 +00:00
parent e64dd5d652
commit 45f0926d41

View File

@@ -684,6 +684,13 @@ static void menu_map(GtkWidget*, wxMenu* menu)
// "hide" from m_menu
static void menu_hide(GtkWidget*, wxMenu* menu)
{
// When using Ubuntu Unity desktop environment we get "hide" signal even
// when the window is not shown yet because Unity hides all the menus to
// show them only in the global menu bar. Just ignore this even instead of
// crashing in DoCommonMenuCallbackCode().
if ( !menu->GetWindow() )
return;
wxMenuEvent event(wxEVT_MENU_CLOSE, menu->m_popupShown ? -1 : 0, menu);
menu->m_popupShown = false;
DoCommonMenuCallbackCode(menu, event);