From: Vadim Zeitlin Date: Fri, 29 Mar 2013 19:53:26 +0000 (+0000) Subject: Fix program not shutting down when using Ubuntu app menu. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/6150a29606ca14c90f29f0449983c106bc72ca84 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 --- diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp index 51e23212bc..09fecd8a14 100644 --- a/src/gtk/menu.cpp +++ b/src/gtk/menu.cpp @@ -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(); } }