1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-25 15:15:09 +00:00

SystemMenu: Don't exit if the shutdown dialog is opened but cancelled

Previously opening the shutdown dialog and cancelling out of it would
cause SystemMenu to exit due to the exit-when-there-are-no-more-windows
mechanism in GUI::Application. Fix this by opting out of it.
This commit is contained in:
Andreas Kling 2020-05-19 17:28:40 +02:00
parent efb3a34e43
commit bc7bf727dd

View file

@ -65,6 +65,7 @@ static NonnullRefPtr<GUI::Menu> build_system_menu();
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
GUI::Application app(argc, argv); GUI::Application app(argc, argv);
app.set_quit_when_last_window_deleted(false);
auto menu = build_system_menu(); auto menu = build_system_menu();
menu->realize_menu_if_needed(); menu->realize_menu_if_needed();