Fix program not shutting down when using Ubuntu app menu.

Ensure that an idle event is generated after a menu event even when the latter
comes, via DBUS, from the out of process app menu and not from a real GTK menu.

Closes #15122.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73737 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2013-03-29 19:53:26 +00:00
parent 4541675262
commit 6150a29606

View File

@ -537,6 +537,14 @@ static void menuitem_activate(GtkWidget*, wxMenuItem* item)
wxMenu* menu = item->GetMenu();
menu->SendEvent(id, item->IsCheckable() ? item->IsChecked() : -1);
// A lot of existing code, including any program that closes its main
// window from a menu handler and expects the program to exit -- as our own
// minimal sample -- relies on getting an idle event after a menu event.
// But when using Ubuntu Unity detached menus, we get called from a DBUS
// handler called from g_timeout_dispatch() and Glib doesn't send us any
// idle events after it. So ask explicitly for an idle event to get one.
wxWakeUpIdle();
}
}