From d8adb049c34def921db5d8d71fc4f5bcbfd0fe41 Mon Sep 17 00:00:00 2001 From: Tim Kosse Date: Mon, 6 Dec 2010 18:40:46 +0000 Subject: [PATCH] In some cases menu bar height is reported as 0 when the menu hasn't fully realized yet. Nee to update the height during idle time if it is 0, otherwise no menu is shown. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@66344 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/frame.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/gtk/frame.cpp b/src/gtk/frame.cpp index 6f4c1b49ab..cc2c2ee516 100644 --- a/src/gtk/frame.cpp +++ b/src/gtk/frame.cpp @@ -560,6 +560,16 @@ void wxFrame::OnInternalIdle() #if wxUSE_MENUS_NATIVE if (m_frameMenuBar) m_frameMenuBar->OnInternalIdle(); + + // UpdateMenuBarSize may return a height of zero on some + // systems (e.g. Ubuntu 11.04 Alpha as of 2010-12-06), + // when the menubar widget has not been fully realized. + // Update the menu bar size again at this point, otherwise + // the menu would not be visible at all. + if (!m_menuBarHeight) + { + UpdateMenuBarSize(); + } #endif // wxUSE_MENUS_NATIVE #if wxUSE_TOOLBAR if (m_frameToolBar) m_frameToolBar->OnInternalIdle();