// "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);
case wx: \
return gtk;
- #if GTK_CHECK_VERSION(2,6,0)
- #define STOCKITEM_26(wx,gtk) STOCKITEM(wx,gtk)
- #else
- #define STOCKITEM_26(wx,gtk)
- #endif
-
#if GTK_CHECK_VERSION(2,8,0)
#define STOCKITEM_28(wx,gtk) STOCKITEM(wx,gtk)
#else
switch (id)
{
- STOCKITEM_26(wxID_ABOUT, GTK_STOCK_ABOUT)
+ STOCKITEM(wxID_ABOUT, GTK_STOCK_ABOUT)
STOCKITEM(wxID_ADD, GTK_STOCK_ADD)
STOCKITEM(wxID_APPLY, GTK_STOCK_APPLY)
STOCKITEM(wxID_BACKWARD, GTK_STOCK_GO_BACK)
STOCKITEM(wxID_CUT, GTK_STOCK_CUT)
STOCKITEM(wxID_DELETE, GTK_STOCK_DELETE)
STOCKITEM(wxID_DOWN, GTK_STOCK_GO_DOWN)
- STOCKITEM_26(wxID_EDIT, GTK_STOCK_EDIT)
+ STOCKITEM(wxID_EDIT, GTK_STOCK_EDIT)
STOCKITEM(wxID_EXECUTE, GTK_STOCK_EXECUTE)
STOCKITEM(wxID_EXIT, GTK_STOCK_QUIT)
- STOCKITEM_26(wxID_FILE, GTK_STOCK_FILE)
+ STOCKITEM(wxID_FILE, GTK_STOCK_FILE)
STOCKITEM(wxID_FIND, GTK_STOCK_FIND)
STOCKITEM(wxID_FIRST, GTK_STOCK_GOTO_FIRST)
STOCKITEM(wxID_FLOPPY, GTK_STOCK_FLOPPY)