1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 21:27:45 +00:00

SpiceAgent: Gracefully exit when the Spice server disconnects

This commit is contained in:
Timothy Flynn 2023-05-21 13:58:25 -04:00 committed by Andreas Kling
parent 36d61c01bc
commit 35fdc7f8c8
3 changed files with 13 additions and 1 deletions

View file

@ -35,7 +35,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(Core::System::unveil(nullptr, nullptr));
auto agent = TRY(SpiceAgent::SpiceAgent::create(SPICE_DEVICE));
TRY(agent->start());
agent->on_disconnected_from_spice_server = [&]() {
app->quit();
};
TRY(agent->start());
return app->exec();
}