diff --git a/src/anbox/cmds/launch.cpp b/src/anbox/cmds/launch.cpp index f4e8202..b484817 100644 --- a/src/anbox/cmds/launch.cpp +++ b/src/anbox/cmds/launch.cpp @@ -19,6 +19,7 @@ #include "anbox/common/wait_handle.h" #include "anbox/dbus/stub/application_manager.h" #include "anbox/common/dispatcher.h" +#include "anbox/ui/splash_screen.h" #include "anbox/runtime.h" #include "anbox/logger.h" @@ -73,6 +74,8 @@ anbox::cmds::Launch::Launch() auto bus = std::make_shared(core::dbus::WellKnownBus::session); bus->install_executor(core::dbus::asio::make_executor(bus, rt->service())); + std::shared_ptr ss; + // Instead of relying on the user session init system to start our // session manager process we also attempt to start it on 0our own // if not already running. This will help to mitigate problems with @@ -84,6 +87,12 @@ anbox::cmds::Launch::Launch() } catch (std::exception &err) { WARNING("Anbox session manager service isn't running, trying to start it."); + // Give us a splash screen as long as we're trying to connect + // with the session manager so the user knows something is + // happening after he started Anbox. + if (!ss) + ss = std::make_shared(); + std::vector args = {"session-manager"}; std::map env; @@ -129,6 +138,7 @@ anbox::cmds::Launch::Launch() } catch (std::exception &err) { ERROR("err %s", err.what()); } + ss.reset(); trap->stop(); return; } @@ -145,6 +155,7 @@ anbox::cmds::Launch::Launch() ERROR("Failed to launch activity: %s", err.what()); success = false; } + ss.reset(); trap->stop(); }); });