[ 1816944 ] GTK - wxMenuBar bug
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49263 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -33,7 +33,7 @@
|
|||||||
// FIXME: is this right? somehow I don't think so (VZ)
|
// FIXME: is this right? somehow I don't think so (VZ)
|
||||||
|
|
||||||
#define gtk_accel_group_attach(g, o) gtk_window_add_accel_group((o), (g))
|
#define gtk_accel_group_attach(g, o) gtk_window_add_accel_group((o), (g))
|
||||||
//#define gtk_accel_group_detach(g, o) gtk_window_remove_accel_group((o), (g))
|
#define gtk_accel_group_detach(g, o) gtk_window_remove_accel_group((o), (g))
|
||||||
//#define gtk_menu_ensure_uline_accel_group(m) gtk_menu_get_accel_group(m)
|
//#define gtk_menu_ensure_uline_accel_group(m) gtk_menu_get_accel_group(m)
|
||||||
|
|
||||||
#define ACCEL_OBJECT GtkWindow
|
#define ACCEL_OBJECT GtkWindow
|
||||||
@@ -239,6 +239,11 @@ static void wxMenubarUnsetInvokingWindow( wxMenu *menu, wxWindow *win )
|
|||||||
while (top_frame->GetParent() && !(top_frame->IsTopLevel()))
|
while (top_frame->GetParent() && !(top_frame->IsTopLevel()))
|
||||||
top_frame = top_frame->GetParent();
|
top_frame = top_frame->GetParent();
|
||||||
|
|
||||||
|
// support for native hot keys
|
||||||
|
ACCEL_OBJECT *obj = ACCEL_OBJ_CAST(top_frame->m_widget);
|
||||||
|
if ( menu->m_accel && g_slist_find( ACCEL_OBJECTS(menu->m_accel), obj ) )
|
||||||
|
gtk_accel_group_detach( menu->m_accel, obj );
|
||||||
|
|
||||||
wxMenuItemList::compatibility_iterator node = menu->GetMenuItems().GetFirst();
|
wxMenuItemList::compatibility_iterator node = menu->GetMenuItems().GetFirst();
|
||||||
while (node)
|
while (node)
|
||||||
{
|
{
|
||||||
@@ -446,8 +451,11 @@ wxMenu *wxMenuBar::Remove(size_t pos)
|
|||||||
|
|
||||||
if( frame )
|
if( frame )
|
||||||
frame->UpdateMenuBarSize();
|
frame->UpdateMenuBarSize();
|
||||||
|
|
||||||
|
wxMenubarUnsetInvokingWindow( menu, m_invokingWindow );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return menu;
|
return menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1049,8 +1057,6 @@ void wxMenu::Init()
|
|||||||
|
|
||||||
wxMenu::~wxMenu()
|
wxMenu::~wxMenu()
|
||||||
{
|
{
|
||||||
WX_CLEAR_LIST(wxMenuItemList, m_items);
|
|
||||||
|
|
||||||
if ( GTK_IS_WIDGET( m_menu ))
|
if ( GTK_IS_WIDGET( m_menu ))
|
||||||
{
|
{
|
||||||
// see wxMenu::Init
|
// see wxMenu::Init
|
||||||
@@ -1062,6 +1068,13 @@ wxMenu::~wxMenu()
|
|||||||
if ( m_owner )
|
if ( m_owner )
|
||||||
gtk_widget_destroy( m_menu );
|
gtk_widget_destroy( m_menu );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This must come after we release GTK resources above. Otherwise, GTK will
|
||||||
|
// give warnings/errors when attempting to free accelerator resources from
|
||||||
|
// child items that just were destroyed (the m_menu widget can contain
|
||||||
|
// references to accelerators in child items. Problem detected when removing
|
||||||
|
// a menu from a wxMenuBar, and the removed menu had submenus with accelerators.)
|
||||||
|
WX_CLEAR_LIST(wxMenuItemList, m_items);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMenu::SetLayoutDirection(const wxLayoutDirection dir)
|
void wxMenu::SetLayoutDirection(const wxLayoutDirection dir)
|
||||||
|
Reference in New Issue
Block a user