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:
parent
4541675262
commit
6150a29606
@ -537,6 +537,14 @@ static void menuitem_activate(GtkWidget*, wxMenuItem* item)
|
|||||||
|
|
||||||
wxMenu* menu = item->GetMenu();
|
wxMenu* menu = item->GetMenu();
|
||||||
menu->SendEvent(id, item->IsCheckable() ? item->IsChecked() : -1);
|
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user